当前位置:网站首页>Postman basic operations
Postman basic operations
2022-06-21 17:03:00 【Expert of explosive liver fist】
One 、Get request
When the request method is get when , Request parameters should be filled in params in , In the form of key value pairs .
Two 、Post request
When the request method is post when , Request parameters should be filled in body in .
x-www-form-urlencoded
Corresponding to Content-Type Header field is x-www-form-urlencoded The type of , Is a form parameter sent as a key value pair , At the same time, the parameters will be carried in url in .form-data
Corresponding to Content-Type Of multipart/form-data type , You can either send key value pairs or pass file parameters .raw
raw Option, you can edit each request using the original format of the request body Content-Type Parameter format corresponding to type , Send the content directly according to the format of the request body . Such as :Json、html Equiformbinary
binary Option to send a file content request .
3、 ... and 、 environment variable
Local environment variables > Global environment variable
Four 、 Assertion
Before request :
stay pre-request scripts Column for setting request pre operation , Such as setting variables .
1. Click on Get an environment variable( Get the current environment variable value )
#ipLoc Name of the environment variable set for
var ip=pm.environment.get("ipLoc");
console.log(ip);

2. Click on Set an environment variable( Set the new environment variable value )
notes : The environment variable is named ipLoc , Variable value is 11.11.11.11
After the request :
stay Test Column by writing code to the status code 、 Response head 、 Response to the body and other information for assertion operation .
Status code: Code is 200( Verify whether the returned response status code is 200)
Response body: Containis string( Verify that the returned body content contains the required string )
notes : Determine whether the returned result contains “ The United States ”, If you have any , Then the prompt is output :“ Include U.S. characters in the body of the returned result ”.
Response body: JSON value check( Judge the return result json Whether the value corresponding to the key specified in the content is the expected character value )

Reponse body:Is equal to a string( Verify whether the content of the returned result is Completely equal )Response headers:Content-Type header check( Verify the header information in the returned result )
Response time is less than 200ms( Verify response time )
5、 ... and 、 Test set
Run the test set : That is, run multiple interface tests at the same time .

6、 ... and 、 Data driven
That is, run multiple request parameters and save them in the format csv External files in .
Assertion :
function run
Be careful :
When there is garbled code , use Notepad++ take csv The file format is changed to UTF-8 code .
Such as :
test result :
边栏推荐
- In 2021 database market, aerospike competes with top manufacturers
- Generating test reports using the unittest framework
- Publicity of the first batch of shortlisted enterprises! Annual Top100 smart network supplier selection
- VNC Viewer方式的远程连接树莓派
- 快来围观–TPT18新版报到
- 好用不贵!11款开源自动化安全测试工具简介
- Wechat applet -image is displayed in the image loading tool, but not in the real machine
- [SQLite] solve unrecognized token:“‘“
- Unittest框架
- Advanced performance test series 6. problem solving and application development
猜你喜欢

数据分析必备:6大步骤+5大类型+2大分析方法

The release of autok3s v0.5.0 continues to be simple and friendly

Pytest框架实现前后置的处理

Huawei cloud releases desktop ide codearts

7 tips for writing effective help documents

How to write test cases

IDC Consulting: in 2022, China's relational database software market is about to change
![Undefined functions or variables [explained in one article] (matlab)](/img/fe/54272b8efce87ed7a78ac43b1fc189.png)
Undefined functions or variables [explained in one article] (matlab)

Cisco (35) -- BGP introduction experiment

Necessary for data analysis: 6 steps +5 types +2 analysis methods
随机推荐
如何判断DNS解析故障?如何解决DNS解析错误?
Google Earth engine (GEE) - sentinel-1 comprehensively check the difference between automatic landslide monitoring before and after two months (Guatemala as an example)
Cloud native monitoring system - Nightingale's recent list of new functions to solve multiple production pain points
The first atlas showing the development history of the database in China was officially released!
The "learning link" database of the learning software is suspected to have leaked information, revealing more than 100million pieces of student information
Fidder工具使用笔记
Pytest框架实现前后置的处理
Machine learning model monitoring (Apria)
Yaml数据驱动演示
深入理解零拷贝技术
Overseas new things | zoovu, an American AI startup, raised a new round of financing of US $169million to optimize the online "product discovery" experience for consumers
Web page automation practice "3. in elong, hotels are accurately matched according to city + date + keyword" part 2
之前的装机记录
【观察】微软“云+端”全面创新,让混合云更简单、更灵活、更安全
招募令|数据可视化开发平台“FlyFish”「超级体验官」招募啦!
Growth is not necessarily related to age
Google Earth Engine(GEE)——用sentinel-2数据获取获取一个月前归一化植被指数NDVI差异(危地马拉为例)
Simulation Implementation of string class
机器学习中的概念漂移(Aporia)
站在数字化风口,工装企业如何“飞起来”