简体   繁体   English

使用 postman 发送 POST 请求,但在 php 中接收 GET 请求。 我尝试使用 postman 创建 API

[英]Send POST request using postman but receiving GET request in php. I try to create API using postman

echo $req=$_SERVER["REQUEST_METHOD"]; // outputs "GET"

I try to create API using postman.我尝试使用 postman 创建 API。 When run this in localhost it's run perfectly but when run this code in a server then it's show me GET.在 localhost 中运行它时运行完美,但是在服务器中运行此代码时它会显示 GET。 can anyone help me?谁能帮我?

Check your server http or https.检查您的服务器 http 或 https。 If server is https And you send http post request then it show this kind of problem.如果服务器是 https 并且您发送 http 发布请求,那么它会显示此类问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM