I already use makeWebRequest to get json data but have to use it to retreive plain text data. I wrote the following code
function loadTextFromUrl( url )
{
var params = {
};
var headers = {
// body will be encoded as 'a=1&b=2'
"Content-Type" => Comm.REQUEST_CONTENT_TYPE_URL_ENCODED
};
var options = {
:method => Comm.HTTP_REQUEST_METHOD_GET,
:headers => headers,
:responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_URL_ENCODED
};
Comm.makeWebRequest(
url,
params,
options,
method(:onReceive)
);
}
the call to makeWebRequest is OK but I get a -400 error (INVALID_HTTP_BODY_IN_NETWORK_RESPONSE). I guess the system tries to decode the received data but I just need to get plain text data.
Is it possible ? How should I call makeWebRequest then ?
Thx