当前位置:网站首页>Data association between two interfaces of postman
Data association between two interfaces of postman
2022-07-07 09:13:00 【zhangyr0916】
scene :
Driver login account app, The driver grabs the bill
After the driver logs in successfully , The server returns a token, The driver's request for a ticket header Add the corresponding token, To grab the order .
Ideas :
1、 Get the return of login interface first token data
2、 extract json Medium access_token Field , And save it to a Postman variable
3、 In the order grabbing interface , Use { { Variable name }} Call the variable value saved by the previous interface
step :
① Create a collection , Put the interface of a module into a set ;

② Create a HTTP request , According to the information in the interface document , Add login interface URL And parameters , Test the driver login interface ;

③ Click on “Send”, Check the interface below to return , return message For success ,access_token The field is returned by the login interface token value , Interface debugging succeeded ;

④ Get the login interface and return json Medium token value ( Use HTTP Request... In the component Test Script ,Test The script is in HTTP Some execution after the request JavaScript Code );
stay Tests Written in JavaScript Code acquisition token, The script is as follows :
// Get the return of the interface json data
var jsonData = pm.response.json();
var sj_token = jsonData.access_token;
// Will the driver token Save in variables sj_token in
pm.globals.set("sj_token",sj_token)

⑤ Create order grabbing interface , Add order grabbing interface URL And parameters ;

⑥ The requested header in , Add just saved token value , Use { {}} To quote Postman Parameters of ;

⑦ Click on “Send” Button , Check the interface return value , Interface request succeeded .

边栏推荐
- Systick tick timer
- Locust performance test 5 (analysis)
- Locust performance test 3 (high concurrency, parameter correlation, assembly point)
- Several stages of PMP preparation study
- Digital triangle model acwing 1027 Grid access
- Unity shader beginner's Essentials (I) -- basic lighting notes
- How does the project manager write the weekly summary and weekly plan?
- OpenGL 3D graphics rendering
- Several common database connection methods
- systemd
猜你喜欢

面板显示技术:LCD与OLED

Three updates to build applications for different types of devices | 2022 i/o key review

Synchronized underlying principle, volatile keyword analysis

Druid monitoring - Introduction to JMX usage and principle

使用Typora编辑markdown上传CSDN时图片大小调整麻烦问题

【Istio Network CRD VirtualService、Envoyfilter】

Port multiplexing and re imaging

【Istio Network CRD VirtualService、Envoyfilter】

Several stages of PMP preparation study

NVIC中断优先级管理
随机推荐
Postman interface test (II. Set global variables \ sets)
What is the rating of Huishang futures company? Is it safe to open an account? I want to open an account, OK?
Postman interface test (I. installation and use)
LED模拟与数字调光
STM32 serial port register library function configuration method
How can I apply for a PMP certificate?
LeetCode 715. Range module
端口复用和重映像
Calf problem
Port occupation troubleshooting
模拟卷Leetcode【普通】1557. 可以到达所有点的最少点数目
【Istio Network CRD VirtualService、Envoyfilter】
LeetCode 736. LISP syntax parsing
【ChaosBlade:节点磁盘填充、杀节点上指定进程、挂起节点上指定进程】
PMP experience learning and sharing process
C language pointer (Part 2)
Locust performance test 5 (analysis)
外部中断实现按键实验
Ppt template and material download website (pure dry goods, recommended Collection)
What are the suggestions for PMP candidates?