当前位置:网站首页>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 .
边栏推荐
- 模拟卷Leetcode【普通】1706. 球会落何处
- 徽商期货公司评级是多少?开户安全吗?我想开户,可以吗?
- How can I apply for a PMP certificate?
- Selenium mouse sliding operation event
- 串口实验——简单数据收发
- Calf problem
- Count the number of words in the string c language
- 个人力扣题目分类记录
- UnityShader入门精要个人总结--基础篇(一)
- Simulation volume leetcode [general] 1567 Length of the longest subarray whose product is a positive number
猜你喜欢
Locust performance test 5 (analysis)
Calf problem
端口复用和重映像
面板显示技术:LCD与OLED
Reflections on the way of enterprise IT architecture transformation (Alibaba's China Taiwan strategic thought and architecture practice)
Unityshader introduction essentials personal summary -- Basic chapter (I)
E-commerce campaign Guide
Hard core sharing: a common toolkit for hardware engineers
【istio简介、架构、组件】
C language pointer (exercises)
随机推荐
Confitest of fixture py
【ChaosBlade:根据标签删除POD、Pod 域名访问异常场景、Pod 文件系统 I/O 故障场景】
2022-06-30 unity core 8 - model import
Original collection of hardware bear (updated on May 2022)
go mod module declares its path as: gtihub. com/xxx-xx but was required as:xx-xx
Interview question: general layout and wiring principles of high-speed PCB
C language pointer (special article)
Register address name mapping
Expérience de port série - simple réception et réception de données
STM32 clock system
Original collection of hardware bear (updated on June 2022)
Why is access to the external network prohibited for internal services of the company?
JVM 内存结构 详细学习笔记(一)
Entity of cesium data visualization (Part 1)
What is the use of PMP certificate?
Systick滴答定时器
Postman interface test (I. installation and use)
【Istio Network CRD VirtualService、Envoyfilter】
模拟卷Leetcode【普通】1567. 乘积为正数的最长子数组长度
面试题:高速PCB一般布局、布线原则