当前位置:网站首页>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 .
边栏推荐
- JVM 内存结构 详细学习笔记(一)
- Goldbach conjecture C language
- Why is access to the external network prohibited for internal services of the company?
- 【ChaosBlade:节点 CPU 负载、节点网络延迟、节点网络丢包、节点域名访问异常】
- 模拟卷Leetcode【普通】1609. 奇偶树
- C language pointer (special article)
- Locust performance test 3 (high concurrency, parameter correlation, assembly point)
- C language pointer (Part 2)
- [chaosblade: delete pod according to the tag, pod domain name access exception scenario, pod file system i/o failure scenario]
- Interview question: general layout and wiring principles of high-speed PCB
猜你喜欢
Expérience de port série - simple réception et réception de données
Postman interface debugging method
串口實驗——簡單數據收發
Cesium load vector data
JVM 内存结构 详细学习笔记(一)
Upgrade Alibaba cloud RDS (relational database service) instance to com mysql. jdbc. exceptions. Troubleshooting of jdbc4.communicationsexception
Run can start normally, and debug doesn't start or report an error, which seems to be stuck
Full link voltage test of the e-commerce campaign Guide
C语言指针(中篇)
STM32串口寄存器库函数配置方法
随机推荐
Esp32-ulp coprocessor low power mode RTC GPIO interrupt wake up
Panel display technology: LCD and OLED
Common short chain design methods
Unity shader beginner's Essentials (I) -- basic lighting notes
STM32的时钟系统
[istio introduction, architecture, components]
Pytest+request+allure+excel interface automatic construction from 0 to 1 [five nails / flying Book notice]
【Istio Network CRD VirtualService、Envoyfilter】
硬核分享:硬件工程师常用工具包
H3C vxlan configuration
systemd
Recommended by Alibaba P8, the test coverage tool - Jacobo is very practical
Synchronized underlying principle, volatile keyword analysis
Druid monitoring - Introduction to JMX usage and principle
Two schemes of unit test
Several stages of PMP preparation study
2021 year end summary
Cmake command line use
模拟卷Leetcode【普通】1705. 吃苹果的最大数目
PMP Exam details after the release of the new exam outline