转载自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. C语言集成开发环境使用小记

    时隔6年,我又重操C语言,是什么让我如此再下定决心?就是不想让自己所学过的知识就此荒废了,我重新以一个C语言初学者的身份(当然,稍稍有点基础,以前的知识忘得没这么快^_^)温故C语言,学习了几天,果真 ...

  2. Flink(一)集群配置

    三台主机 centos6 已经完成的工作: 防火墙已关闭 主机名修改完毕,ssh免密登陆配置完成 jdk已安装 zookeeper已经部署并运行 hadoop已经部署并运行 版本:flink-1.8. ...

  3. python 网络编程:socket(二)

    上节地址:Python网络编程:socket 一.send和sendall区别 send,sendall         ret = send('safagsgdsegsdgew') #send 发送 ...

  4. express上传图片

    var express = require('express') var app = express() var proxy = require('http-proxy-middleware') co ...

  5. mysql 用户权限管理详细

    用户管理 mysql>use mysql; 查看 mysql> select host,user,password from user ; 创建 mysql> create user ...

  6. 为什么我markdown里的数学公式全崩了???

    目录 try a try ac is ok Typecho博客 https://www.diyifanwen.com/fanwen/dangyuanxindetihui/2665516.htm htt ...

  7. VMware里克隆出来的CentOS Linux device eth0 does not seem to be present, delaying initialization

    解决办法:1.ifconfig eth1 确定新网卡的MAC地址.nmcli con 确定新网卡的UUIDvim /etc/udev/rules.d/70-persistent-net.rules把原 ...

  8. 【转】JMX之ObjectName

    原文链接:https://blog.csdn.net/yunlong34574/article/details/46563187 ObjectName 就是存储了一个domain(域)下的一些属性,属 ...

  9. webstorm 去点右边白线

    file>settings>editor>general>appearance>show right margin(configured in code style oo ...

  10. Tomcat 配置安装

    1 下载和安装Tomcat服务器 Tomcat官方站点:http://jakarta.apache.org 下载Tomcat安装程序包:http://tomcat.apache.org/ 启动和测试T ...