Home Forums Development Open a new Session

Viewing 3 reply threads
  • Author
    Posts
    • #8326

      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
    • #8654
      Ed ShawEd Shaw
      Keymaster

      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
    • #8760
      Aditya PhatakAditya Phatak
      Participant

      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
    • #8767
      Ed ShawEd Shaw
      Keymaster

      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…

      BTW, this returns with a “Method Not Allowed” from google, because GET is the only supported verb.

      Thanks,

      Ed

      0
Viewing 3 reply threads
  • You must be logged in to reply to this topic.