[Solved] Web API POST with "x-www-form-urlencoded" Body

Hi,

I am dealing with an API, which requires data to be sent in “x-www-form-urlencoded” type BODY. I could not find a way to send BODY data in “x-www-form-urlencoded” form.

If you have heard of Postman API Platform, where you can send test requests to API, I have sent BODY data in “x-www-form-urlencoded” form from it. The response successfully comes, and everything is good in Postman. Here’s the screenshot of Postman BODY area -

image

If you could suggest any way to send data in BODY with “x-www-form-urlencoded” form in Thunkable X, it would be helpful.

Thanks! :blush:

Hi,

see scrWebAPI

https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/

1 Like

Hi, @actech! :wave:
Thanks a lot for your reply! :blush:

I think you misunderstood my question :sweat_smile:

Your blocks set the body to just “x-www-form-urlencoded”.

image

What I want is, set BODY to “x-www-form-urlencoded” type of data. Here’s a description of what’s “x-www-form-urlencoded” - click here

Thunkable X only has the option of setting BODY to a text string.

Thanks! :blush:

Try to indicate this type in the header, for example, xmlhttp.setRequestHeader (‘Content-Type’, ‘application/x-www-form-urlencoded’);

2 Likes

Thank you so much @actech! :tada:

Your Solution worked perfectly :+1: :+1:
TBH, before your solution came, I spent my whole day searching how to set BODY :sweat_smile:

Thanks a lot! :blush:

1 Like