Sending GET request parameters in body

后端 未结 3 647
青春惊慌失措
青春惊慌失措 2020-12-30 03:49

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 para

相关标签:
3条回答
  • 2020-12-30 04:44

    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

    0 讨论(0)
  • 2020-12-30 04:44

    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
    0 讨论(0)
  • 2020-12-30 04:53

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

    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.

    0 讨论(0)
提交回复
热议问题