php 将 POSTMAN 请求转换为 Curl
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/49432735/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Converting a POSTMAN request to Curl
提问by Coder
I am calling my java webservice (POST request) via POSTMAN in the following manner which works perfectly fine (i.e. I can see my records getting inserted into the database):
我通过 POSTMAN 调用我的 java web 服务(POST 请求),其工作正常(即我可以看到我的记录被插入到数据库中):
And, here's how the contents inside the Headers(1)
tab looks like:
而且,Headers(1)
选项卡内的内容如下所示:
Instead of calling it via POSTMAN, I have to call the same request in PHP using CURL. I am wondering if there's a way to export this command to curl
command so that I could use it in my PHP code? I have found opposite approach at many places online where someone is asking to convert Curl based request to POSTMAN but couldn't figure out how to do the opposite.
我必须使用 CURL 在 PHP 中调用相同的请求,而不是通过 POSTMAN 调用它。我想知道是否有办法将此命令导出到curl
命令以便我可以在我的 PHP 代码中使用它?我在网上的许多地方发现了相反的方法,有人要求将基于 Curl 的请求转换为 POSTMAN,但不知道如何做相反的事情。
Some articles I found for curl to postman
我找到了一些文章,用于 curl 到邮递员