Home › Forums › Development › Open a new Session
- This topic has 3 replies, 3 voices, and was last updated 7 years, 3 months ago by Ed Shaw.
-
AuthorPosts
-
-
April 6, 2017 at 12:44 pm #8326Eric SchattschneiderParticipant
Is there some way we can force a new session to open, rather than a new tab when using Channel’getURL ?? We have a need to do that and was wondering if there is a way to do it. Thanks
0 -
August 23, 2017 at 2:36 pm #8654Ed ShawKeymaster
Eric,
This one fell through the cracks. Did you get an answer? If so, what was the resolution? If not, could I get a bit more information about the question. I’m not sure how you are using getURL and what the issue is.
Thanks,
Ed
0 -
September 21, 2017 at 9:12 am #8760Aditya PhatakParticipant
Hi Ed,
It appears to be a try to establish a URL Connection through NexJ. I tried to work on a similar requirement to invoke a URL with HTTP POST method. But it seems we have a limited support of URLConncetion and its equivalent java libraries. The method “getURL” also refers to the same library and is currently not supported in NexJ.
I gave a simple try using below scheme script:
(import’ java.net.HttpURLConnection)
(import’ java.net.URLConnection)
(import’ java.net.URL)
(import’ java.io.DataOutputStream)
(define baseurl “http://www.google.co.in”)
(define connection java.net.HttpURLConnection)
; Constructing an object of url:
(define url (java.net.URL’new baseurl))
; Typecast into HttpURLConnection the above url object:
(define httpCon (connection’cast (url’openConnection)))Post this, if you try to play with httpCon, it doesnt recognize any method of HttpURLConnection library. For example,
((connection’cast (url’openConnection))’setRequestMethod “POST”)
If there is a workaround to setup a URL connection using NexJ Scheme, please do share with us.
0 -
September 21, 2017 at 11:38 am #8767Ed ShawKeymaster
Ok. If we want to make an HTTP request then it is super simple. Just create an HTTP message and send it over a channel. You can inspect the HTTP message type by entering (message and then ctrl-space in a scratchpad. Simple code would look like…
Scheme1234567(define request(message (: :class "HTTP")(: url "http://www.google.co.in")(: method "POST")))(define response (integration-send-receive request "RSSClient" ()))BTW, this returns with a “Method Not Allowed” from google, because GET is the only supported verb.
Thanks,
Ed
0
-
-
AuthorPosts
- You must be logged in to reply to this topic.