I've been trying to setup a POST request in my REST API; however I'm having an issue with the body I send on the request; the body contains a nested object, but the payload is always sent as a string; I've followed the steps mentioned in this article:
But the same thing happens, no matter how I choose to format the object it is always sent as an escaped string, which prevents my API to actually recognize the body and just returns an empty message.
I need the payload to be an actual JSON, any ideas?
It seems like the Object output is the same in both our setups. Does the body still send as a text type even when using the JSON object key/value setup? Also, for this resource, are there any other headers that might be overriding the headers you are supplying?
I'm having the same issue trying to pass a JSON object to the Jira ID (for filtering Issues based on a project and filter. This is my Body:
{
"jql": "project = INTSD and filter = 17653"
}
I've tried constructing the string in a Component, using a Raw body, JSON Key:Values but I always see the request body adding the escape characters, same as you it seems. For example:
"body": "{\"jql\": \"project = INTSD and filter = 17653\"}"
Attempted using JSON.parse just now, but same result.
Do you have access to the API to see what it is receiving?
I tested out the same payload using an API I spun up in Pipedream to generate an endpoint, and the body of the request was coming in as JSON even though in Retool the Query Output will always show the body as a string with a ton of '' in it.
Also have you tried clicking on the dropdown under "Body" to the query to switch from Raw to JSON? If your API is giving back an error message if you could share that it would be helpful to debug.
I tried {"method": "", "params": {"key1": "", "key2": ""} } under RAW and it showed that my API I spun up in Pipedream was receiving JSON as the body.