var options = {
:method => Comm.HTTP_REQUEST_METHOD_POST,
:headers => {
HEADER_APP_ID => APP_ID,
HEADER_CLIENT_KEY => CLIENT_KEY,
HEADER_SESSION_TOKEN => sessionToken,
HEADER_CONTENT_TYPE => Comm.REQUEST_CONTENT_TYPE_JSON
},
:responseType => Comm.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
Comm.makeWebRequest(
url,
params,
options,
method(:onReceive)
);
This works fine when params does not contain boolean values
params = {
"some_key" => "some_value"
}
But fails when params contains boolean values
params = {
"some_key" => true
}
When the boolean value is true, we get 'error 400 {error=>Unexpected token T in JSON at position xyz}' and when the value is false we get 'error 400 {error=>Unexpected token F in JSON at position xyz}'
I'm assuming that the sdk is transforming the values to "True" and "False" instead of "true" and "false" :(