当前位置:网站首页>Postman 导入curl 、导出成curl、导出成对应语言代码
Postman 导入curl 、导出成curl、导出成对应语言代码
2022-07-26 04:20:00 【BUG指挥官】
1、postman导入curl
点击左上角的「import」按钮,在弹窗中选中「Raw text」,输入想被导入的curl 后,点击 「continue」按钮

随后点击弹窗右下角出现的「import」按钮,curl 请求就会被自动解析为http请求了。


如果左上角没找到「import」按钮,可以点击导航栏的「file」,下拉列表中同样有「file」功能入口。
2、postman将http请求导出成curl
如果想将 http 请求导出成 curl 命令,可以点击「code」链接,

如果你从网上搜索「postman将http请求导出成curl」,基本上的博客都是让你找这个「code」按钮,但是postman版本或者操作系统版本的原因,反正我的mac 电脑没有上面图中的「code」链接,取而代之的是右侧有个「</>」图标,点击这个图标可以达到和上面点击「code」链接一样的效果。

在接下来的下拉列表中选中「curl」

随后就生成了curl命令,全选复制或者点击右侧的「复制」图标均可完成复制,然后就可以把这个curl分享给其他人或者在控制台运行了。

3、导入成对应语言代码
还是点击「code」链接或者右侧的「</>」图标,我这里只有「</>」图标,所以点击这个图标

在下来列表中选中你想导入的语言版本,比如我这里想导出成 python 语言用requests库编写的http代码,所以我选中了「Python - Request」

随后代码就生成完毕了,这个方式有一个应用场景就是自己写的脚本请求结果不对,但是postman的请求结果是正确的,这个时候可以导出成对应语言的代码,对比自己写的代码哪里不对,很快就能找到问题所在。

4、保存http请求
如果我们想把某个请求保存下来以后接着用,我们可以点击「Save」按钮,选择保存的文件夹后,点击「save」按钮

可以看到左侧已经多了一个刚才创建的集合,这个集合里只有「百度」这个请求

边栏推荐
猜你喜欢

青少年创客教育的创意设计原理

Helloworld案例分析

What are the duplicate check rules for English papers?

This article takes you to graph transformers

When you try to delete all bad code in the program | daily anecdotes

makefile知识再整理(超详细)

Li Kou daily question - day 42 -661. Picture smoother

使用百度飞桨EasyDL完成垃圾分类

Firewall command simple operation
![[project chapter - how to write and map the business model? (3000 word graphic summary suggestions)] project plan of innovation and entrepreneurship competition and application form of national Entrep](/img/e8/b115b85e2e0547545e85b2058a9bb0.png)
[project chapter - how to write and map the business model? (3000 word graphic summary suggestions)] project plan of innovation and entrepreneurship competition and application form of national Entrep
随机推荐
MySQL的优化分析及效率执行
生活相关——一个华科研究生导师的肺腑之言(主要适用于理工科)
【SVN】一直出现 Please execute the ‘Cleanup‘ command,cleanup以后没有反应的解决办法
支持代理直连Oracle数据库,JumpServer堡垒机v2.24.0发布
When you try to delete all bad code in the program | daily anecdotes
p-范数(2-范数 即 欧几里得范数)
LeetCode:1184. 公交站间的距离————简单
香甜的黄油
What format should be adopted when the references are foreign documents?
【学习笔记】AGC041
What model is good for the analysis of influencing factors?
Design and implementation of smart campus applet based on cloud development
How to write the introduction and conclusion of an overview paper?
Dijango learning
机器学习之桑基图(用于用户行为分析)
Wu Enda's machine learning after class exercises - logical regression
How to download the supplementary literature?
How to write the summary? (including 7 easily ignored precautions and a summary of common sentence patterns in 80% of review articles)
华为再发“天才少年”全球召集令,有人曾放弃360万年薪加入
Life related - ten years of career experience (turn)