当前位置:网站首页>How to use the apipost script - global variables
How to use the apipost script - global variables
2022-06-28 22:19:00 【51CTO】
One 、 Global variables
Set a global variable :apt.globals.set("key", "value");
It can be used apt.globals.set() Set a custom value , Such as :apt.globals.set("test", " This is a global variable ");
apt.globals.set() Methods can be similar to request Method 、response Methods used together .
apt.globals.set() and request Method can be used together to get the current request : Such as
apt.globals.set("request", request); Get current request details
apt.globals.set("url", request.url); Get the currently requested url
apt.globals.set("method", request.method); Get the currently requested method
apt.globals.set("timeout", request.timeout); Gets the current request timeout
apt.globals.set("contentType", request.contentType); Get the currently requested content-type
apt.globals.set("bodys", request.request_bodys); Get the current request body
apt.globals.set("headers", request.request_headers); Get the current request header
apt.globals.set("querys", request.request_querys); Get the currently requested querys
apt.globals.set() and response Method to get the current response : Such as
apt.globals.set("response", response); Get the response to the current request
apt.globals.set("json", response.json); The response is a json When , obtain json Response data in format
apt.globals.set("headers", response.headers); Get the current response header
apt.globals.set("cookies", response.cookies); Get the response to the current request cookie
apt.globals.set("raw", response.raw); Get the original response data
apt.globals.set("status", response.raw.status); Get the current response status code (200、301、400 etc. )
apt.globals.set("responseTime", response.raw.responseTime); Get the current response time ( millisecond )
apt.globals.set("type", response.raw.type); Get the current response type (json etc. )
apt.globals.set("responseText", response.raw.responseText); Get the current response text
Apipost The official link : https://console.apipost.cn/register?utm_source=10006
Tool download address : https://console.apipost.cn/register?utm_source=10006
边栏推荐
- How many stages did the development and evolution of data analysis go through?
- Use of axurer9 option group
- docker下载Mysql镜像创建数据库链接时候发生密码错误问题
- Safety innovation practice | Haitai Fangyuan was invited to participate in the technical exchange Seminar on "network information innovation and value co creation in the digital age"
- Rule engine development experience sharing - reddit
- Visual studio 2022 17.1 is now available!
- 穿越过后,她说多元宇宙真的存在
- Common tool classes and Commons class libraries
- 职场人调研报告:裸辞占比最高的居然是中年人
- Hyperjumptech/grule-rule-engine: rule engine implementation of golang
猜你喜欢

C#/VB.NET 将PDF转为Excel

Description détaillée du schéma technique du sous - environnement syntonique auto - test de Zadig pour les développeurs

这个简单的小功能,半年为我们产研团队省下213个小时

PE file-

After reading the list of global patent and chip buyers, I understand that high innovation can lead to high profits

Nc1033 palindrome substring of small a (ring, interval DP)

ROS 2 Humble Hawksbill 之 f1tenth gym

6年心得,从功能测试到测试开发,送给在测试路上一路走到黑的你

Zadig officially launched vs code plug-in, making local development more efficient

华为云的AI深潜之旅
随机推荐
代码复查
Hashicorp/raft introduction and source code analysis (III): introduction to cluster node recovery
[linq] execute SQL like in statements using EF to LINQ
What is the prospect of VR panoramic production?
Un voyage profond d'IA dans Huawei Cloud
Pat 1024 palindromic number (25 points) sum of large integers
常用工具类与commons 类库
Quartz定时任务触发器启动时设置
Progress in visual weakly supervised learning
【电子实验2】简单电子门铃
硬件开发笔记(七): 硬件开发基本流程,制作一个USB转RS232的模块(六):创建0603封装并关联原理图元器件
现在还能入“坑”数据分析吗?看看2022年数据分析热门岗位!
Sword finger offer:[day 1 stack and queue (simple)] --- > use two stacks to realize the queue
Gross vs60 billion. Is food safety the biggest obstacle to Weilong's listing?
Description détaillée du schéma technique du sous - environnement syntonique auto - test de Zadig pour les développeurs
windows mysql5.7 开启binlog日志
数据可视化中柱状图的实例应用,让乘风破浪公演结果一目了然
Pat 1054 the dominiant color (20 points)
为什么要使用 Rust 语言?
Visual studio 2022 17.1 is now available!