今天我们来讲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. 使用visual C++测试

    背景:学习一门语言最好的方式就是实际动手敲一遍.现在敲一遍的障碍是不能熟练的使用工具,特此记录下来 新建工程 新建——项目——Windows 控制台应用程序 如何新建测试用例呢? OJ试题在VS201 ...

  2. css实现文本溢出显示省略号

    看到很多网站上的文章列表只显示一部分,之后就是一个阅读全文链接,或者是以一个省略号结尾.今天就说说单行文本,多行文本溢出时怎么显示省略号? 单行 overflow: hidden; white-spa ...

  3. python面向对象中的一些特殊__方法__

    1. __doc__ 表示类的描述信息 class Foo: """ 描述类信息""" def func(self): pass print ...

  4. (链表 递归) leetcode 24. Swap Nodes in Pairs

    Given a linked list, swap every two adjacent nodes and return its head. You may not modify the value ...

  5. (线性dp 最大连续和)POJ 2479 Maximum sum

    Maximum sum Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 44459   Accepted: 13794 Des ...

  6. 二进制部署 Kubernetes 集群

    二进制部署 Kubernetes 集群   提供的几种Kubernetes部署方式 minikube Minikube是一个工具,可以在本地快速运行一个单点的Kubernetes,尝试Kubernet ...

  7. Mac 软件专题之:OS X Yosemite 精彩应用软件推荐

    目前,很多软件都已经发布了针对Yosemite系统的版本,今天和大家分享专题:「OS X Yosemite 精彩应用」,主要分享适配Yosemite系统全新的扁平化界面和新功能的软件,但要知道未在此专 ...

  8. JSP学习记录

    <%@ page contentType="text/html;charset=gb2312" %> <html> <h1>计算器</h1 ...

  9. 设计模式---接口隔离模式之代理模式(Proxy)

    一:概念 代理模式(Proxy Pattern)就是为其他对象提供一种代理以控制对这个对象的访问. 比如: 智能指针 为别人做嫁衣 所谓代理,是指具有与代理元(被代理的对象)具有相同的接口的类,客户端 ...

  10. jest-babel报错:Requires Babel "^7.0.0-0", but was loaded with "6.26.3"

    解决方法: yarn remove jest babel-jest babel-core @babel/core yarn add --dev jest babel-jest babel-core@^ ...