Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

XSJS call http service always gets redirected(HTTP 303)

$
0
0

Dear Experts,

   I am trying to call a http service from xsjs. The http service is also implemented with xsjs which located in the same package, no proxy, no authentication.

   The http connection is defined in "xshttpdest" file as following:

host = "localhost";

port = 8000;

   And then the service is called in a standard way like this:

 

var destination = $.net.http.readDestination("package_name", "localhost");

 

var client      = new $.net.http.Client();

 

var req = new $.web.WebRequest($.net.http.POST, "/packagename/service.xsjs");

req.contentType = "application/json";

req.setBody(JSON.stringify(input));

 

var response = client.request(req, destination).getResponse();

$.response.setBody(response.status);

 

   The problem is that the response body is always empty, and the HTTP status is always 303(redirected). Can someone shed some light on this?

 

Thanks and regards,

Yang


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>