# Http Request activity to send body using POST method

**URL:** <https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652>\
**Category:** Help\
**Tags:** webapi, activities\
**Created:** [February 28, 2019, 10:00am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652 "2019-02-28T10:00:30Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [February 28, 2019, 10:00am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/1 "2019-02-28T10:00:30Z")

</div>

I have to send three parameters which are in the format of Key/Value pair in the body of POST method in HTTP request activity. Can you help how to do that ?

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [February 28, 2019, 10:08am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/2 "2019-02-28T10:08:41Z")

</div>

Hi @raviranjan,

You have to import Soap and Rest activities from the packages (Hope you know it 🙂)

Then drag the activity “HTTP Request” into your sequence, it will prompt for the URL and the parameters, you can change the request type as well

---

<div class="post-metadata">

**Author:** ![Rajeswari24](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rajeswari24/32/314911_2.png) [@Rajeswari24](https://forum.uipath.com/u/Rajeswari24)\
**Post date:** [February 28, 2019, 10:11am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/3 "2019-02-28T10:11:26Z")

</div>

Hi Raviranjan,

Using body of POST method you can send it in 2 formats.  
JSON or XML.

if JSON  
“{”“Key1"”:““value1"”,”“key2"”:““value2"”,”“key3"”:““value3"”}”

Normal JSON will have double quotes or single quotes for key and values but while sending in Body you have to escape the double quotes with another double quotes.(as shown above)

Note: if the value is a interger no need to give double quotes.

Please refer to the following link

> [@HTTP Post Request error](https://forum.uipath.com/t/http-post-request-error/32881/10):
>
> Hi Sarathi , one question. Is following syntax is correct for HTTP Request Body? { "webServiceReq":{ "channelId":"RPA", "cifId":"123456789", "serReqId":"getlist", "requestUUID":"12345678", "request": { "custId":"0122345678" } } }

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [February 28, 2019, 12:40pm UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/4 "2019-02-28T12:40:27Z")

</div>

I understood this part but i need to pass parameters in body as shown in SS. More like a dictionary elements. How do i do that ? ![ss](https://global.discourse-cdn.com/uipath/original/3X/d/3/d3002cb5cad6799e198be3d93af91043c2ace580.png)

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [February 28, 2019, 12:41pm UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/5 "2019-02-28T12:41:21Z")

</div>

I used postman for the same and i am getting the correct output with it.

---

<div class="post-metadata">

**Author:** ![Rajeswari24](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rajeswari24/32/314911_2.png) [@Rajeswari24](https://forum.uipath.com/u/Rajeswari24)\
**Post date:** [February 28, 2019, 12:47pm UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/6 "2019-02-28T12:47:02Z")

</div>

Can you copy paste the JSON as string instead of screenshot.

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [February 28, 2019, 12:54pm UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/7 "2019-02-28T12:54:28Z")

</div>

Have a look at this

> [@UiPath Orchestrator API : StartJobs](https://forum.uipath.com/t/uipath-orchestrator-api-startjobs/3154/2):
>
> Hi, The solution is very easy flushed, passign the data in the Body property of the HTTP Request activity.

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [February 28, 2019, 1:10pm UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/8 "2019-02-28T13:10:00Z")

</div>

I just tried the same as in the above link, it is working exactly and was a great solution.

Change your body type to application/json and make your body as a string .  
Here is the sample body which i tried

“{”“Key”" : ““Value””,““Key”” : ““Value””,““Key”” : ““Value””}"

Make sure it is a string and you can directly paste in the body

Just simple make the single (“) to double (”") so that it will make the json as string and you don’t need to give spaces for each key value pair.

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 4:51am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/9 "2019-03-01T04:51:38Z")

</div>

the json which i am sending is as follows:  
“{”“attributes”“:{”“Name”“:”“West Trail”“,”“x\_axis”“:-58.0854173175099,”“y\_axis”“:6.81321583105365}}”  
(Above json is only for the ‘adds’ key from the SS)  
But i don’t know how to send the whole key value in single body format.

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 5:14am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/10 "2019-03-01T05:14:10Z")

</div>

I tried the following strings:  
“{f:json,token:XXXX-XXXX-XXXX-XXXX,adds:{”“attributes”“:{”“Name”“:”“West Trail”“,”“type”“:”“Hiking Path”“,”“altitiude”“:542.34}}”

And…

“{”“f:”“json”“,”“token”“:”“XXXX-XXXX-XXXX-XXXX”“,”“adds”“:{”“attributes”“:{”“Name”“:”“West Trail”“,”“type”“:”“Hiking Path”“,”“altitude”":542.34}}

But none area working. Need help

---

<div class="post-metadata">

**Author:** ![Rajeswari24](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rajeswari24/32/314911_2.png) [@Rajeswari24](https://forum.uipath.com/u/Rajeswari24)\
**Post date:** [March 1, 2019, 5:24am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/11 "2019-03-01T05:24:12Z")

</div>

Try this

“{”“f”“:”“json”“,”“token”“:”“xxx-xxxx”“,”“adds”“:{”“attributes”“:{”“Name”“:”“West Trail”“,”“type”“:”“Hiking Path”“,”“altitude”“:542.34}}}”

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [March 1, 2019, 6:03am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/12 "2019-03-01T06:03:06Z")

</div>

> [@raviranjan](#):
>
> “{”“f:”“json”“,”“token”“:”“XXXX-XXXX-XXXX-XXXX”“,”“adds”“:{”“attributes”“:{”“Name”“:”“West Trail”“,”“type”“:”“Hiking Path”“,”“altitude”":542.34}}

Try this…  
“{”“f”“:”“json”“,”“token”“:”“XXXX-XXXX-XXXX-XXXX”“,”“adds”“:”“{”“attributes”“:”“{”“Name”“:”“West Trail”“,”“type”“:”“Hiking Path”“,”“altitude”“:”“542.34"”}“”}"

I hope It will work for sure

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 6:03am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/13 "2019-03-01T06:03:36Z")

</div>

Nope. 😕  
No luck. One more thing, do i need to pass OAuth2 token in Http Request activity also or just send it along body as we are doing now. Or do we need to pass token in both places.

---

<div class="post-metadata">

**Author:** ![HareeshMR](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/hareeshmr/32/181825_2.png) [@HareeshMR](https://forum.uipath.com/u/HareeshMR)\
**Post date:** [March 1, 2019, 6:11am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/14 "2019-03-01T06:11:26Z")

</div>

Have you tried the last one @raviranjan??

Let me know if it is working 🙂

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 6:19am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/15 "2019-03-01T06:19:10Z")

</div>

Yup. Just tried it. Its not working 😕.  
Basically, this should upload the given attributes(‘Name’, ‘type’, ‘altitude’, etc.) to a website(Endpoint).  
I am attaching the .xaml file. Hope it could help.

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 6:55am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/16 "2019-03-01T06:55:43Z")

</div>

[Main.xaml](https://global.discourse-cdn.com/uipath/original/3X/b/6/b66fa0730f8bbdbcc808ce9d6fe331bfd53342ea.xaml) (7.0 KB)

---

<div class="post-metadata">

**Author:** ![Rajeswari24](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/rajeswari24/32/314911_2.png) [@Rajeswari24](https://forum.uipath.com/u/Rajeswari24)\
**Post date:** [March 1, 2019, 8:35am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/17 "2019-03-01T08:35:05Z")

</div>

Its working and returning 200 success status code. Please find attached xaml.

[Main (1).xaml](https://global.discourse-cdn.com/uipath/original/3X/0/6/06583c2a68bb719b4b107fcd2c6daae3c6f26b11.xaml) (7.3 KB)

---

<div class="post-metadata">

**Author:** ![raviranjan](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@raviranjan](https://forum.uipath.com/u/raviranjan)\
**Post date:** [March 1, 2019, 10:04am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/18 "2019-03-01T10:04:11Z")

</div>

Yeah. But, the problem is its not updating the list in the website which is supposed to be updated after this query. And also, it will return 200 even if the token provided is incorrect. 200 is just an indication that it is successfully hitting the endpoint.

---

<div class="post-metadata">

**Author:** ![Pankaj\_Yadav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/pankaj_yadav/32/176783_2.png) [@Pankaj\_Yadav](https://forum.uipath.com/u/Pankaj_Yadav)\
**Post date:** [December 16, 2019, 11:11am UTC](https://forum.uipath.com/t/http-request-activity-to-send-body-using-post-method/98652/19 "2019-12-16T11:11:48Z")

</div>

Hi @raviranjan, I am facing the same issue, wanted to know if you were able to resolve the problem, It will be great help for me if you can assist. I am getting the result as 200 with UiPath http request but not able to post the data to the end point, but it is working perfectly with the postman. looking forward for your response

Regards,  
pankaj
