Humanoid
Humanoid copied to clipboard
Fixes invalid body returned for JSON APIs
About the fix
This minor fix changes how JSON responses are stringified. Instead of using .toString(), we use JSON.stringify when dataType="json"
Original Issue:
Currently, if I call a JSON REST API with dataType="json", the response object returned by humanoid is as follows:
{
statusCode: 200,
statusMessage: 'OK',
body: '[object Object]'
}
But the expected response would be:
{
statusCode: 200,
statusMessage: 'OK',
body: '{"data": "all the data"}'
}