基本请求
新建一个普通的线程组
![](https://ucc.alicdn.com/images/user-upload-01/471d75eb5e6944cbbe260ca36370109e.png?x-oss-process=image/resize,w_1400/format,webp)
再建立一个普通的http取样器
![](https://ucc.alicdn.com/images/user-upload-01/6c388b3fb5c640f4932442fee530b71d.png?x-oss-process=image/resize,w_1400/format,webp)
信息填写
![](https://ucc.alicdn.com/images/user-upload-01/9839dcf9aee9419c81b97be4f81067aa.png?x-oss-process=image/resize,w_1400/format,webp)
查看运行结果
![](https://ucc.alicdn.com/images/user-upload-01/edade13c23b74a52a68033a69daaad0a.png?x-oss-process=image/resize,w_1400/format,webp)
点击运行查看结果
![](https://ucc.alicdn.com/images/user-upload-01/762c35a617984c15a50eb75567f46cbe.png?x-oss-process=image/resize,w_1400/format,webp)
通过响应数据分析失败原因:token缺失,去添加请求头
![](https://ucc.alicdn.com/images/user-upload-01/84f1bedb980f4cc78bd317192b93615e.png?x-oss-process=image/resize,w_1400/format,webp)
请求头header信息填写
![](https://ucc.alicdn.com/images/user-upload-01/d56189c8a5324e8784b9fe45b78c1b35.png?x-oss-process=image/resize,w_1400/format,webp)
现在就可以请求成功了
![](https://ucc.alicdn.com/images/user-upload-01/002807afc109458190782ad4897333ab.png?x-oss-process=image/resize,w_1400/format,webp)
几种参数请求
Params参数填写
![](https://ucc.alicdn.com/images/user-upload-01/0e7e1b72773a4be7a4fca40c950de754.png?x-oss-process=image/resize,w_1400/format,webp)
json和表单格式参数填写
在信息头加上这个content-type application/json;charset=UTF-8就是json格式
![](https://ucc.alicdn.com/images/user-upload-01/e1ed081b0531401ca5f5c482bfa845ea.png?x-oss-process=image/resize,w_1400/format,webp)
json断言
![](https://ucc.alicdn.com/images/user-upload-01/0749b18ce3014005813f08d8570652d8.png?x-oss-process=image/resize,w_1400/format,webp)
参数提取和使用
json提取器
![](https://ucc.alicdn.com/images/user-upload-01/63b401c6aab649858ff8d4233fe66fc2.png?x-oss-process=image/resize,w_1400/format,webp)
填写变量名和变量提取表达式
![](https://ucc.alicdn.com/images/user-upload-01/75a9f0d6bd8a464e85cf2721e3a5901a.png?x-oss-process=image/resize,w_1400/format,webp)
使用变量
在一个线程中可以使用
![](https://ucc.alicdn.com/images/user-upload-01/d42a7502f8ee45b291a637bda477fd9c.png?x-oss-process=image/resize,w_1400/format,webp)
全局变量设置和使用
![](https://ucc.alicdn.com/images/user-upload-01/cb3c4f01e9f04589a3ab521042aab930.png?x-oss-process=image/resize,w_1400/format,webp)
注意移动到最前面
![](https://ucc.alicdn.com/images/user-upload-01/2aea37ae5a314f52bb2c58cb258e827f.png?x-oss-process=image/resize,w_1400/format,webp)
使用
![](https://ucc.alicdn.com/images/user-upload-01/3bb3ca602cbd4573a986713836286655.png?x-oss-process=image/resize,w_1400/format,webp)
![](https://ucc.alicdn.com/images/user-upload-01/4100abacbfcc4af9997f84cf59885ffe.png?x-oss-process=image/resize,w_1400/format,webp)
函数
需要网上查,列举下怎么用
![](https://ucc.alicdn.com/images/user-upload-01/6f12189207c94301aec2b0bac414ee1b.png?x-oss-process=image/resize,w_1400/format,webp)