content-type:在Request Headers里,告诉服务器我们发送的请求信息是哪种格式的

content-type 常见的格式有如下三种

1. content-type:application/x-www-form-urlencoded

默认格式:如果不指定content-type,默认使用此格式。

参数格式:key1=value1&key2=value2

jmeter中请求添加该类参数时可以有两种方法添加:

1.以参数形式添加

jmeter学习4--http请求content-type与参数

2.一消息体数据添加

jmeter学习4--http请求content-type与参数

2  content-type:application/json

参数为json格式

添加步骤:

1.添加一个HTTP消息头管理器,定义content-type为application/json格式

2.在请求的消息体数据中,将json字符串粘贴进去

jmeter学习4--http请求content-type与参数

jmeter学习4--http请求content-type与参数

3.content-type:multipart/form-data

这个类型主要用来上传文件

添加步骤:

1.勾选对post使用 multipart/form-data

2.Parameters中输入除了上传的文件以外的参数:参数名和参数值

3.Files Upload中上传文件,参数名和MIME类型

jmeter学习4--http请求content-type与参数

 

jmeter学习4--http请求content-type与参数

 

 

 

 

 

 

 

 

 

 

 

 

 

 

相关文章:

  • 2022-02-14
  • 2021-05-19
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2021-11-11
  • 2021-04-12
  • 2022-12-23
  • 2021-04-18
相关资源
相似解决方案