We are setting up a webhook receiving a value with Content-Type: application/x-www-form-urlencoded at a Post endpoint, and are struggling to parse it into a JSON value. How do you do this?
Hi Lavrans,
When you add the POST method for an endpoint the Body Data property is revealed. You can use that to map the keys from the request body (e.g. logout_token) to a data source.
The screenshot below shows an example where I’ve mapped it to a service variable.
I have done this, but Appfarm is not able to parse the body content as it is formatted as Content-Type: application/x-www-form-urlencoded.
I have also tried parsing the result, but I cannot treat the rawBodyContent as a string which means that I cannot turn it into a JSON structure.
When I run a test from Postman with Content-Type: application/x-www-form-urlencoded
it works as I described. Have you tried that?
When you send a request from dev tools it doesn’t seem to set an explicit Content Type and I guess it defaults to JSON which is why you are seeing that error.
I got it to work now as well. Sending from devtools was the issue. Thank you!