REST Request


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

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.

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?

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

Here is a how I run this request in Postman.

My Send requests run successfully

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.

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

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.

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?

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