Skip to Content
avatar image
Former Member

XSJS Service HTTP call

Hi, I am making a Node JS http request call to one of my xsjs services. I am not getting any text back. On the console log, I get a 302 status code. I looked this code online and it is apparently due to some type of redirection. As per (, it could be an authentication problem, but I am completely sure my service is public and requires no authentication.

On my http request call, I have

host : ' . .....',

path: '/<application name>/<xsjs file name>.xsjs?param1=value1'

What could be causing this problem?

Thank You


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 14, 2017 at 02:38 PM

    So, I was simply not handling the redirection.

    One Node.js, the function, http.request(options, function(res) { }), does not handle redirection. So for instance, if you request 'http' vs. 'https', it will throw one of these 302 status codes. A better alternative I found, with some help, is the request function ( This does handle redirection.

    Also here:

    Add comment
    10|10000 characters needed characters exceeded