今天我们来讲3种常见的content-type方式,及jmeter应用时信息头和传参方式的不同;

参照博客http://www.cnblogs.com/imyalost/p/6726795.html

一、先介绍几种content-type方式,在Request请求的header信息中

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

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

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

2)content-type:  application/json

传参格式如下:

3)form-data格式:

传参格式:name="XXXX";value="XXXX";

二、这几种格式在jmeter中如何传参

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

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

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

2)content-type:application/json

首先要添加http信息头管理器:

在http请求中的“body”中输入参数,如下:

3)content-type:form-data格式

在添加的http请求中一定要勾选

传参:

jmeter(五)几种不同的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. 转载 SharePoint【Site Definition 系列】– 创建Content Type

    转载原地址:  http://www.cnblogs.com/wsdj-ITtech/archive/2012/09/01/2470274.html Sharepoint本身就是一个丰富的大容器,里面 ...

  4. the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header

    the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header ...

  5. Springs Element 'beans' cannot have character [children], because the type's content type is element-only

    Springs Element 'beans' cannot have character [children], because the type's content type is element ...

  6. .NET获取文件的MIME类型(Content Type)

    第一种:这种获取MIME类型(Content Type)的方法需要在.NET 4.5之后才能够支持,但是非常简单. 优点:方便快捷 缺点:只能在.NET 4.5之后使用 public FileResu ...

  7. Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决

    Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决 引言: 在Java中 ...

  8. {"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 ...

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

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

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

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

随机推荐

  1. Django 获取访问者信息

    request内的META里有请求用户的信息 #定义视图方法 def get_ip(request): #打印头部所以信息 # print(request.META) # 获取ip信息 if &quo ...

  2. 扩展方法、委托和Lambda

    举例演化Lambda string[] names ={"Burke", "Connor", "Frank", "Everett& ...

  3. vcf文件去除非变异的基因型(use GATK exclude nonvariant in vcf format,0|0,0/0)

    对于某些特殊vcf,想去除没有变异的基因型(主要形式为0|0或者0/0),则需要用到GATK的--excludeNonVariants参数,命令行如下: java -Xmx8g -jar Genome ...

  4. Methods for follow-up research of exome analysis:外显子后续分析研究思路总结

    外显子后续分析研究思路一般有以下几种(Methods for follow-up research of exome analysis): 1.对突变频率.突变类型.突变方式进行统计分析 Mutati ...

  5. python config.ini的应用

    config.ini文件的结构是以下这样的:结构是"[ ]"之下是一个section,一部分一部分的结构.以下有三个section,分别为section0,section1,sec ...

  6. C/S,B/S的应用的区别

    C/S和B/S都是软件架构方式: C/S(Client/Server) :客户端/服务器结构,其中客户端和服务器端都是独立的计算机,客户端是面向用户的应用程序或者是接口,服务器端通常采用高性能的PC. ...

  7. 16、计算1加到100用两个定义值count=1、sum=0

    #!/user/bin/python# -*- coding:utf-8 -*-count = 1sum = 0while count <= 100: sum = sum + count cou ...

  8. 信用评分卡 (part 5 of 7)

    python信用评分卡(附代码,博主录制) https://study.163.com/course/introduction.htm?courseId=1005214003&utm_camp ...

  9. iptables之端口限速

    #iptables -A FORWARD -p tcp -m tcp --sport 10000 -m limit --limit 500/sec --limit-burst 1000 -j ACCE ...

  10. Selenium模块的使用

    Selenium是一个Web的自动化测试工具,最初是为网站自动化测试而开发的,类型像我们玩游戏用的按键精灵,可以按指定的命令自动操作,不同是Selenium 可以直接运行在浏览器上,它支持所有主流的浏 ...