Sending POST parameters with Postman doesn't work, but sending GET parameters does

前端 未结 10 718
名媛妹妹
名媛妹妹 2020-12-02 10:04

I\'m trying to test a simple PHP page using the Chrome extension Postman. When I send URL parameters, the script works fine (eg the variables are available in the $_RE

相关标签:
10条回答
  • 2020-12-02 10:42

    I was having the same problem. To fix it I added the following headers:

    Content-Type: application/json
    

    I had to manually add the content type even though I also had the type of "json" in the raw post field parameters.

    0 讨论(0)
  • 2020-12-02 10:43

    When you send parameters by x-www-form-urlencoded then you need to set header for the request as using Content-Type as application/x-www-form-urlencoded

    0 讨论(0)
  • 2020-12-02 10:44

    Sorry if this is thread Necromancy, but this is still relevant today, especially with how much APIs are used!

    An issue I had was: I didn't know that under the 'Key' column you need to put: 'Content-Type'; I thought this was a User Key for when it came back in the request, which it isn't.

    So something as simple as that may help you, I think Postman could word that column better, because I didn't even have to read the Documentation when it came to using Fiddler; whereas I did with Postman.

    0 讨论(0)
  • 2020-12-02 10:45

    I faced the same issue in PostMan and Advance REST Client both. I checked through fiddler and found that my request payload is not converted into JSON format.

    I am passing my data in Body as x-www-form-urlencoded

    You can fix it by using Content-Type as application/x-www-form-urlencoded in request header.

    0 讨论(0)
  • 2020-12-02 10:48

    Instead of using raw JSON body, try using form-data.

    0 讨论(0)
  • 2020-12-02 10:54

    Sometimes Version problem in 'Postman' :

    I have face the same problem. While sending the data using the oldest version of postman.
    That time I have received the empty json data in server side.
    And I have fix this problem, Once I uninstall the oldest version of postman and installed with latest version.

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