将 POSTMAN 请求转换为 Curl [英] Converting a POSTMAN request to Curl

查看:59
本文介绍了将 POSTMAN 请求转换为 Curl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 POSTMAN 调用我的 java web 服务(POST 请求),其工作正常(即我可以看到我的记录被插入到数据库中):

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):

而且,Headers(1) 选项卡中的内容如下所示:

And, here's how the contents inside the Headers(1) tab looks like:

我必须使用 CURL 在 PHP 中调用相同的请求,而不是通过 POSTMAN 调用它.我想知道是否有办法将此命令导出到 curl 命令以便我可以在我的 PHP 代码中使用它?我在网上的许多地方发现了相反的方法,有人要求将基于 Curl 的请求转换为 POSTMAN,但不知道如何做相反的事情.

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.

我发现的一些

您可以看到按钮代码"在附加的屏幕截图中,按下它,您可以获得多种不同语言的代码,包括 PHP cURL

You can see the button "Code" in the attached screenshot, press it and you can get your code in many different languages including PHP cURL

已正如其他答案所说的 Postman UI 已更新,我相应地更改了图像

Edited: As other answers said Postman UI was updated, I change the images accordingly

这篇关于将 POSTMAN 请求转换为 Curl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆