转载自https://www.cnblogs.com/imyalost/p/6726795.html

本文讲三种content-type以及在Jmeter中对应的参数输入方式

第一部分:目前工作中涉及到的content-type 有三种:

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

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

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

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

2 content-type:application/json

参数为json格式

{

"key1":"value1",

"key2":"value2"

}

3 content-type:multipart/form-data [dinghanhua]

上传文件用这种格式

发送的请求示例:

第二部分  不同的content-type如何输入参数

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

参数可以在Parameters或Body Data里输入,格式不同,如下图所示。

这两个参数输入的tab页只能使用一个,某一个有数据后不能切换到另一个。

Parameters:

Body Data:

2  content-type:application/json

 2.1 首先添加信息头管理。http请求上点击右键》添加》配置元件》 HTTP信息头管理器

JMeter Http请求之content-type用法的更多相关文章

  1. Jmeter发送post请求报错Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    常识普及: Content-type,在Request Headers里面,告诉服务器,我们发送的请求信息格式,在JMeter中,信息头存储在信息头管理器中,所以在做接口测试的时候,我们维护Conte ...

  2. jmeter报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported"的解决方法

    1.报"msg":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supporte ...

  3. Jsoup问题---获取http协议请求失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    Jsoup问题---获取http协议请求失败 1.问题:用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不 ...

  4. {"timestamp":"2019-11-12T02:39:28.949+0000","status":415,"error":"Unsupported Media Type","message":"Content type 'text/plain;charset=UTF-8' not supported","path":&quo

    在Jmeter运行http请求时报错: {"timestamp":"2019-11-12T02:39:28.949+0000","status&quo ...

  5. Jsoup获取部分页面数据失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

    用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 请求代码如下: private static ...

  6. Jmeter 参数化请求实例

    Jmeter 参数化请求实例 在jmeter中的请求可以参数化,其中参数化的方式有4种: 1.CSV Data Set Config 2.数据库 3.用户自定义变量 4.用jmeter中的函数获取参数 ...

  7. ajax使用向Spring MVC发送JSON数据出现 org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported错误

    ajax使用向Spring MVC发送JSON数据时,后端Controller在接受JSON数据时报org.springframework.web.HttpMediaTypeNotSupportedE ...

  8. Jsoup获取部分页面数据失败 Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml

    用Jsoup在获取一些网站的数据时,起初获取很顺利,但是在访问某浪的数据是Jsoup报错,应该是请求头里面的请求类型(ContextType)不符合要求. 请求代码如下: private static ...

  9. Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported告诉你,你的请求头是application/x- ...

  10. 接入WxPusher微信推送服务出现错误:Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

    背景 使用WxPusher微信推送服务 ,可以及时的将服务的一些运行异常信息,发送到自己的微信上,方便了解服务的运行状态(PS:这个服务是免费的). 你可以在这里看到WxPusher微信推送服务的接入 ...

随机推荐

  1. 常用js校验

    身份证 function isCardNo(idCard){ //15位和18位身份证号码的正则表达式 var regIdCard=/^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0 ...

  2. 【MySQL】mysql查询强制大小写及替换字段

    强制大小写 select * from test where name like BINARY '%Adc%' mysql替换字段 update test set name= REPLACE (nam ...

  3. Python基础(一):程序输入输出、判断合法用户、编写判断成绩的程序

    一.程序输入输出 目标: 编写login.py脚本,实现以下目标: 提示用户输入用户名 将用户名保存在变量中 在屏幕上显示欢迎用户的信息 方案: 编写程序时,很多情况下都需要程序与用户交互.在pyth ...

  4. tomcat 高并发

    转自 http://blog.csdn.net/feng27156/article/details/19420695 一.容器简化了程序员自身的多线程编程. 各种Web容器,如Tomcat,Resio ...

  5. MySQL if,ifnull,nullif 函数

    一.IF IF(exPR1,expr2,expr3) 如果 expr1 是TRUE (expr1 <> 0 and expr1 <> NULL),则 IF()的返回值为expr ...

  6. ubuntu 18.04 自启动

    按下面二种方式打开自启动设置窗口,设置启动参数:(两种方式) 方式一:在桌面左上角的搜索框中输入Startup Applications,打开,点击Add,Name处填open_terminal(自定 ...

  7. iframe调用页面中的局部部分

    iframe 调用网页,div遮挡展现局部. <div style=" width:iframe宽度; height:iframe高度; overflow:hidden "& ...

  8. oninput 事件 比较angular张的 ng-model指令 和 Vue中的 v-model指令

    oninput 事件在用户输入时触发. 该事件在 <input> 或 <textarea> 元素的值发生改变时触发. 提示: 该事件类似于 onchange 事件.不同之处在于 ...

  9. LeetCode题:旋转链表

    原题: 给定一个链表,旋转链表,将链表每个节点向右移动 k 个位置,其中 k 是非负数. 示例 1: 输入: 1->2->3->4->5->NULL, k = 2输出: ...

  10. 【LCT维护子树信息】uoj207 共价大爷游长沙

    这道题思路方面就不多讲了,主要是通过这题学一下lct维护子树信息. lct某节点u的子树信息由其重链的一棵splay上信息和若干轻儿子子树信息合并而成. splay是有子树结构的,可以在rotate, ...