jhon.smith
jhon.smith

Reputation: 2043

Sending GET request parameters in body

I have an API which accepts many parameters. Passing the values of the parameters will exceed the length of the URL Header.

I am using Postman client to pass the parameters in the body but this is not working any ideas on how to make this work.

The API accepts many parameters because the backend is legacy and is exposed as an API by a service bus.

Upvotes: 26

Views: 140082

Answers (5)

Adam Obuchowski
Adam Obuchowski

Reputation: 1

If you want to make a GET request in Postman then you can use Params or Body to pass parameters, but not both. Either Params only or Body only. If you specify both Params and Body, Postman will select and send only Params (in GET request of course). So if you want it to send Body, clear Params.

Upvotes: 0

Badr Bellaj
Badr Bellaj

Reputation: 12871

Latest Postman supports body object for Get request enter image description here

just choose json format as shown in pic above

Upvotes: 0

Denis Koreyba
Denis Koreyba

Reputation: 3718

Older versions of Postman didn't allow you to send body data with get request.

Yet, if your server receives data as URL parameters you won't be able just to change the way of sending them and include them to the body (server won't accept them).

So if the length of parameters is indeed so big and the server indeed can receive the same data from body instead of from parameters then the Postman is just not the tool that you can use (maybe cURL is for you).

If your server allows to send data only as URL parameters and they are so long (more then 2000 chars What is the maximum length of a URL in different browsers?) then I think you have no chances to test this API.

UPDATE: new Version 7.20.1 now allows to send Body with GET request

Upvotes: 28

Rahul Uttarkar
Rahul Uttarkar

Reputation: 3645

Postman is already added this feature of sending body in get request.

enter image description here

But i still i recommended to go for post request (if body is present) since many projects like angular http client does't have updated protocols yet.

Upvotes: 7

Steve Mullin
Steve Mullin

Reputation: 207

Workaround:

  1. Change the request type to POST.
  2. Set the value of your body
  3. Change request type to GET
  4. Send request and the body is included

Upvotes: 19

Related Questions