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

前端 未结 10 748
名媛妹妹
名媛妹妹 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:56

    For me, the server was expect HTTPS requests, but I didn't specify that in the URL. The hook would reach the server, but the body would be empty.

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

    Simply use the Body Tab and enter the post parameters there. Note that Body Tab is disabled if Get is selected.

    0 讨论(0)
  • 2020-12-02 11:02

    I was setting the url in Postman to be http:// but Apache was redirecting to https:// and somehow the POST variables were being dropped along the way.

    After I changed it to https://, the POST variables worked properly.

    See also: https://stackoverflow.com/a/28461500/704803

    0 讨论(0)
  • 2020-12-02 11:03

    Check your content-type in the header. I was having issue with this sending raw JSON and my content-type as application/json in the POSTMAN header.

    my php was seeing jack all in the request post. It wasn't until i change the content-type to application/x-www-form-urlencoded with the JSON in the RAW textarea and its type as JSON, did my PHP app start to see the post data. not what i expected when deal with raw json but its now working for what i need.

    postman POST request

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