# REST Request

**URL:** <https://forum.katalon.com/t/rest-request/16733>\
**Category:** Miscellaneous\
**Created:** [January 4, 2019, 10:29am UTC](https://forum.katalon.com/t/rest-request/16733 "2019-01-04T10:29:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/katalon/original/3X/d/5/d55596ab02785a255798e87ede769734747b30c4.svg) [@system](https://forum.katalon.com/u/system)\
**Post date:** [January 4, 2019, 10:29am UTC](https://forum.katalon.com/t/rest-request/16733/1 "2019-01-04T10:29:13Z")

</div>

* * *
This is a companion discussion topic for the original entry at [https://docs.katalon.com/katalon-studio/docs/restful.html](https://docs.katalon.com/katalon-studio/docs/restful.html)

---

<div class="post-metadata">

**Author:** ![SNats](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/snats/32/16104_2.png) [@SNats](https://forum.katalon.com/u/SNats)\
**Post date:** [September 23, 2019, 7:00pm UTC](https://forum.katalon.com/t/rest-request/16733/2 "2019-09-23T19:00:58Z")

</div>

Hi, I am trying to make POST request with a csv file as http body and am only receiving 404 Bad request.

My object repository request details:  
Method: POST  
url: http  
Auntorization: None  
Headers: api\_key  
Body: \*\*\*\*\*.csv file

Please advice what setting I have make for this POST request to work.

---

<div class="post-metadata">

**Author:** ![Peter\_Wilson](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@Peter\_Wilson](https://forum.katalon.com/u/Peter_Wilson)\
**Post date:** [September 23, 2019, 7:11pm UTC](https://forum.katalon.com/t/rest-request/16733/3 "2019-09-23T19:11:36Z")

</div>

Can you give a bit more detail on what you mean by csv files as HTTP Body?  
Does that mean you are parametizing the post body and reading the value from a csv file?  
If you create the Object and and send the request manually, do you get a valid response?  
We will probably need a bit more sample code to see what is happening?

---

<div class="post-metadata">

**Author:** ![SNats](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/snats/32/16104_2.png) [@SNats](https://forum.katalon.com/u/SNats)\
**Post date:** [September 23, 2019, 8:29pm UTC](https://forum.katalon.com/t/rest-request/16733/4 "2019-09-23T20:29:12Z")

</div>

Here is the Object Repo object for my POST request. the file attached will create sites or locations in my application which has couple of columns

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/d/d9552aef47f6e082cbc6f286d4deaa3125559c78.png)

Here is a how I run this request in Postman.

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/a/ab9aedadce567d751d12725759c961f169f7210c.png)

My Send requests run successfully

---

<div class="post-metadata">

**Author:** ![Peter\_Wilson](https://avatars.discourse-cdn.com/v4/letter/p/9fc29f/32.png) [@Peter\_Wilson](https://forum.katalon.com/u/Peter_Wilson)\
**Post date:** [September 24, 2019, 12:03am UTC](https://forum.katalon.com/t/rest-request/16733/5 "2019-09-24T00:03:14Z")

</div>

To be honest, I haven’t seen it done this way. Normally, the Object is the API payload with parameters such as:

```
> {
> [order_id]: ${order_id}
> [address]: ${address}
> }

```

Then on the variables tab, those variables are defined with their type.  
Within the code, you read the values from the file, assign them to variables, then pass those as parameters to the Object.

The send would look something like:  
initialize\_order = WS.sendRequest(findTestObject(‘Object’,  
[(‘order\_id’) : order\_id,  
(‘address’) : user\_address]))

The CSV would hold the values you want to pass.

---

<div class="post-metadata">

**Author:** ![SNats](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/snats/32/16104_2.png) [@SNats](https://forum.katalon.com/u/SNats)\
**Post date:** [September 24, 2019, 5:36pm UTC](https://forum.katalon.com/t/rest-request/16733/6 "2019-09-24T17:36:39Z")

</div>

Thank you for looking into this. Our Api only accepts a .csv or .xlsx file types in form-data. I will keep trying and update once I find a solution.  
Thile has first row as header and each remaining row is all values for that header

---

<div class="post-metadata">

**Author:** ![lokesh.kambhoji](https://avatars.discourse-cdn.com/v4/letter/l/c6cbf5/32.png) [@lokesh.kambhoji](https://forum.katalon.com/u/lokesh.kambhoji)\
**Post date:** [January 17, 2020, 9:44am UTC](https://forum.katalon.com/t/rest-request/16733/7 "2020-01-17T09:44:01Z")

</div>

Hi,  
i have two API requests. After executing first request access token will be generated in response body(JSON body).Now i want to pass this access token to the second request in the form of header. Generated access token will expire in 60 minutes.  
How can i store this access token either in the form of global variable or some other location and passing to the second request dynamically  
Please help me on this.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![yaa\_lian](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/yaa_lian/32/16103_2.png) [@yaa\_lian](https://forum.katalon.com/u/yaa_lian)\
**Post date:** [July 20, 2020, 6:54am UTC](https://forum.katalon.com/t/rest-request/16733/8 "2020-07-20T06:54:30Z")

</div>

Hi, do you able to solve it ? my runtime Access Token is needed in the HTTP Header for POST API.  
Could you share the solution on how to to pass in the Access Token?

---

<div class="post-metadata">

**Author:** ![vijayalakshmi1](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vijayalakshmi1/32/16104_2.png) [@vijayalakshmi1](https://forum.katalon.com/u/vijayalakshmi1)\
**Post date:** [December 18, 2021, 9:59am UTC](https://forum.katalon.com/t/rest-request/16733/9 "2021-12-18T09:59:06Z")

</div>

I am facing a similar problem… Please let me know how you resolved the same.
