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