Jmeter—3 http请求—content-type与参数

本文讲三种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信息头管理器

2.2  信息头编辑页面,点击添加,输入content-type application/json

2.3 在http请求,Body Data中输入json格式的参数

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

在http请求编辑页面,选中Use multipart/form-data for POST

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

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

上传文件如果不成功,修改Implementation为java试一下。

the end!

JMETER content-type增加的更多相关文章

  1. 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 ...

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

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

  3. 转载 SharePoint【Site Definition 系列】– 创建Content Type

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

  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问题---获取http协议请求失败 org.jsoup.UnsupportedMimeTypeException: Unhandled content type. Must be text/*, application/xml, or application/xhtml+xml.

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

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

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

  7. SharePoint自动化系列——Add content type to list.

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 将创建好的content type(若是跨web application需要事先publish c ...

  8. SharePoint自动化系列——Content Type相关timer jobs一键执行

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 背景: 在SharePoint Central Administration->Monito ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. win32编程简介

    win32编程简介 复习Win32整理下知识. 为什么学习win32? 我们要编写windos程序.都离不开API. 也就是我们所说的win32程序. 所以学好win32是你能不能再windows下编 ...

  2. maven自动部署项目以及常见问题解决

    Maven自动部署war到Tomcat1. 在maven项目的pom里配置如下信息 <build> <finalName>dianxiao</finalName> ...

  3. AD预测论文研读系列1

    A Deep Learning Model to Predict a Diagnosis of Alzheimer Disease by Using 18F-FDG PET of the Brain ...

  4. HashMap在JDK1.8中并发操作,代码测试以及源码分析

    HashMap在JDK1.8中并发操作不会出现死循环,只会出现缺数据.测试如下: package JDKSource; import java.util.HashMap; import java.ut ...

  5. c++中虚函数和多态性

    1.直接看下列代码: #include <iostream> using namespace std; class base{ public: void who(){ cout<&l ...

  6. 菜鸟入门【ASP.NET Core】10:Cookie-based认证实现

    准备工作 新建MVC项目,然后用VSCode打开 dotnet new mvc --name MvcCookieAuthSample 在Controllers文件夹下新建AdminController ...

  7. [redis] Redis的介绍

    mysql数据库:数据以“文件的形式”存储在硬盘里 网站的瓶颈是在数据库的访问上,mysql数据库是运行在硬盘上面的,把数据放到内存里速度就快多了 Redis是一款内存高速缓存数据库,使用c语言编写, ...

  8. (1)Microsoft office Word 2013版本操作入门_常用功能区

    word2013界面做了比较大的优化,刚开始用的时候不太习惯,研究了一下win10下word的新版本,记录以下几个功能小技巧: 1.常用功能区: 新打开一个word文档  文件.开始 .插入 等菜单称 ...

  9. Java基础——Oracle(三)

    一.Oracle内部结构 1.表空间 表空间是数据库的逻辑划分,一个表空间只属于一个数据库,每个表空间由一个或多个数据文件组成,表空间中其他的逻辑结构的数据存储在这些数据文件中,一般oracle系统安 ...

  10. Python 练习:三级菜单选择城市(二)

    优化了上一个三级菜单选择城:http://www.cnblogs.com/klvchen/p/8646466.html info = { 'GuangDong':{ 'GuangZhou': ['Ti ...