Skip to Content

XSJS Service HTTP call

Jul 13, 2017 at 01:48 PM


avatar image
Former Member

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


10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

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:

10 |10000 characters needed characters left characters exceeded