on 07-13-2017 2:48 PM
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 (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7ccd3e4e-0501-0010-95ae-afa58cb46b75), 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 : '<database name>.<username (i.e ....trial)>.....hanatrial.ondemand.com',
path: '/<application name>/<xsjs file name>.xsjs?param1=value1'
What could be causing this problem?
Thank You
-Diana
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 (https://www.npmjs.com/package/request). This does handle redirection.
Also here: https://stackoverflow.com/questions/7323932/how-do-you-follow-an-http-redirect-in-node-js
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.