当前位置:网站首页>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 .

边栏推荐
- 使用Typora编辑markdown上传CSDN时图片大小调整麻烦问题
- Port multiplexing and re imaging
- How does the project manager write the weekly summary and weekly plan?
- Why is access to the external network prohibited for internal services of the company?
- Postman interface debugging method
- NVIC中断优先级管理
- systemd
- Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
- Calf problem
- 端口复用和重映像
猜你喜欢
随机推荐
Several common database connection methods
【Istio Network CRD VirtualService、Envoyfilter】
Do you have any certificates with high gold content?
Regularly modify the system time of the computer
2022-07-06 unity core 9 - 3D animation
Hard core sharing: a common toolkit for hardware engineers
Unityshader introduction essentials personal summary -- Basic chapter (I)
Skill review of test engineer before interview
Screen automatically generates database documents
Simulation volume leetcode [general] 1609 Parity tree
端口复用和重映像
Simulation volume leetcode [general] 1567 Length of the longest subarray whose product is a positive number
E-commerce campaign Guide
LeetCode 736. LISP syntax parsing
How to use Arthas to view class variable values
Markdown editor Use of MD plug-in
Panel display technology: LCD and OLED
JVM 内存结构 详细学习笔记(一)
Unity shader beginner's Essentials (I) -- basic lighting notes
PMP certificate preparation experience sharing









