Comm.makeJsonRequest(
"myfileaddress.example/file.txt",
{
},
{
"Content-Type" => Comm.REQUEST_CONTENT_TYPE_URL_ENCODED
},
method(:onReceive)
);
File on server is JSON text file. Server returns:
Content-Type: text/plain; charset=windows-1251
Tried parameter REQUEST_CONTENT_TYPE_JSON - the same result.
curl returns content on this address, so server is alive and url is correct.
Please could you provide examples with all the parameters description? Why it is changed? Sorry, I can't understand how to use everything specified in documentation, not obvious. It worked in the past when app was developed (1.2.9 SDK as I remember).
I am interested how to use these constants:
HTTP_RESPONSE_CONTENT_TYPE_JSON = 0
The expected response from making a web request
Since:
1.3.0
HTTP_RESPONSE_CONTENT_TYPE_URL_ENCODED = 1
Since:
1.3.0
REQUEST_CONTENT_TYPE_URL_ENCODED = 0
These values are used in conjunction with the “Content-Type” header key.
Specifies a content type of application/x-www-form-urlencoded
Since:
1.2.0
REQUEST_CONTENT_TYPE_JSON = 1
Specifies a content type of application/json
Since:
1.2.0