当前位置:网站首页>ApiPost的环境变量的定义和使用「ApiPost环境变量」
ApiPost的环境变量的定义和使用「ApiPost环境变量」
2022-06-10 09:51:00 【sik1】
新版的ApiPost(Chrome拓展V2.0.8+/客户端V2.2.1+)已经支持环境变量的定义和使用。
本文主要介绍ApiPost环境变量的第一课:如何定义环境变量,并如何使用它。
ApiPost简介:
ApiPost是一个支持团队协作,并可直接生成文档的API调试、管理工具。它支持模拟POST、GET、PUT等常见请求,是后台接口开发者或前端、接口测试人员不可多得的工具 。
官网:https://console.apipost.cn/register?utm_source=10008
什么是环境变量?
对于一些常见的参数,我们可以将其定义成环境变量,以便达到一处改动,全部改动的目的。
例如我们请求的URL域名,完全可以将其设置为环境变量,在URL栏只输入路由即可。这样的话,我们可以通过控制环境变量的值,来达到请求不同域名、相同路由的API接口(比如可以用来快速切换开发环境和生产环境)。
如下图所示,我们将域名定义成了变量:url。
如何定义环境变量?
如上面的例子,我们将域名定义成了变量:url。但是此时,如果点击【发送】会提示错误,因为虽然您使用了环境变量url,但您还没有正式定义它。
那么我们是在上面地方定义它呢?
如下图所示,我们需要先创建一个环境,然后,定义环境变量的key和value。
第一步:点击发送按钮上方的【未选择环境】——【新建环境】来新建一个环境
第二步:点击【新建环境】,我们就可以定义一个环境,并为这个环境定义一些变量了。如下图所示:
第三步:保存
如上如所示,我们定一个环境【开发环境】,并定义了2个变量:url和test变量。点击【保存环境】按钮保存。
第四步:测试
此时选择我们刚创建的【开发环境】,然后点击发送,就出现正常的响应结果了。
环境变量定义后,我们就可以使用他们了。调用环境变量的方法是: {{变量名}}
边栏推荐
- To serve the "nervous system" with a broad and subtle vision
- 2022劳务员-岗位技能(劳务员)考试试题及答案
- [dark horse morning post] ant group has no IPO plan yet; Weiya's husband set up a new live broadcasting company; CEO of Weibo questioned SF; JD will pilot the catering takeout business; Tencent's tale
- QChart笔记1:简单线性图LineSeries
- Uncaught TypeError: Cannot read properties of undefined (reading ‘colspan‘)
- R语言使用coin包应用于连续变量独立性问题的置换检验(permutation tests)、在同一数据集上使用Wilcoxon秩和检验和和置换检验中的wilcox_test精确检验
- Basic process of program compilation
- What are the tools and software needed for SCM development
- 提升.NET技术水平,我是怎么做的
- R语言plotly可视化:plotly可视化堆叠stacked的直方图、自定义设置条形之间的间距(Stacked Histograms)
猜你喜欢

SQL SERVER Always on 监控脚本与一些听到的误解

成都自控开发_单片机程序的一般开发流程是怎样

Basic process of program compilation

程序编译基本过程

Browser cache forbidden explanation

PostgreSQL 代价模型

Cf1304c air conditioner

Ce soir - là, j'ai battu mon collègue...

Only this is the most true reason why leaders promote you. The rest is nonsense!
![[image feature extraction] image feature extraction based on MATLAB pulse coupled neural network (PCNN) [including Matlab source code 1868]](/img/ca/59f8390c67ceb682e43db7ff8acfd6.png)
[image feature extraction] image feature extraction based on MATLAB pulse coupled neural network (PCNN) [including Matlab source code 1868]
随机推荐
OSG basic operation
5g Unicom network management design idea
Notes to docker advanced (6) master-slave replication of MySQL in docker
53. maximum subarray and
成都測試設備定制_單片機C語言之數據類型初步介紹
聯調這夜,我把同事打了...
Lambda表达式例一
Google Earth Engine(GEE)——GPWv411:平均行政单位面积数据集
618来袭,大量优惠券生成太耗时?ThreadPoolTaskExecutor线程池帮你来搞定
Lambda表达式
osg基本操作
Go practice | remember the optimization of reducing CPU utilization by 30% at a time
张小白教你使用OGG实现Oracle 19C到MySQL 5.7的数据同步(2)
【图像去噪】基于matlab BdCNN图像去噪【含Matlab源码 1866期】
无心剑中译拜伦诗4首
单片机开发需要的工具以及软件有哪些
01 backpack problem
Design of smart home control system (onenet) based on stm32_ two thousand and twenty-two
Why should the R & D effectiveness team of Internet companies be independent? When is independence?
HMM详细介绍+举例