# How to set up Post endpoint with Content-Type: application/x-www-form-urlencoded?

**URL:** <https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092>\
**Category:** Ask the community\
**Tags:** service\
**Created:** [March 6, 2024, 12:15pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092 "2024-03-06T12:15:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lavrans](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lavrans/32/1460_2.png) [@Lavrans](https://community.appfarm.io/u/Lavrans)\
**Post date:** [March 6, 2024, 12:15pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092/1 "2024-03-06T12:15:48Z")

</div>

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?  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/6/6feb4962fd7dae021eb82289e1918ef957bcfa00.png)

---

<div class="post-metadata">

**Author:** ![aaron](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/aaron/32/36_2.png) [@aaron](https://community.appfarm.io/u/aaron)\
**Post date:** [March 6, 2024, 2:40pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092/2 "2024-03-06T14:40:54Z")

</div>

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.

 ![Screenshot 2024-03-06 at 15.37.14](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/5817c1c4793f7079a0a99a1e6b2e126f02242950.png)

---

<div class="post-metadata">

**Author:** ![Lavrans](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lavrans/32/1460_2.png) [@Lavrans](https://community.appfarm.io/u/Lavrans)\
**Post date:** [March 6, 2024, 3:09pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092/3 "2024-03-06T15:09:39Z")

</div>

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.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/5/59b4c55c46fcc9d461227daaaee50473585c8c62.png)

---

<div class="post-metadata">

**Author:** ![aaron](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/aaron/32/36_2.png) [@aaron](https://community.appfarm.io/u/aaron)\
**Post date:** [March 6, 2024, 3:19pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092/4 "2024-03-06T15:19:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lavrans](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/lavrans/32/1460_2.png) [@Lavrans](https://community.appfarm.io/u/Lavrans)\
**Post date:** [March 6, 2024, 3:48pm UTC](https://community.appfarm.io/t/how-to-set-up-post-endpoint-with-content-type-application-x-www-form-urlencoded/1092/5 "2024-03-06T15:48:09Z")

</div>

I got it to work now as well. Sending from devtools was the issue. Thank you! 😃
