JMeter file upload interface multipart/form-data

tags: JMeter  Experience sharing

Common content-types for http requests are divided into three types: application/json, x-www-form-urlencoded, multipart/form-data. multipart/form-data is mainly used in scenarios where files need to be uploaded in post request bodies

1.jmeter request

1. Fill in protocal, host, port, method, url, encoding, etc.;

2. Check Use multipart/form-data for POST

3. Fill in the file path, parameter name, and MIME type that needs to be uploaded in Files Upload

The following figure can determine the parameter name and MIME type

 

2. MIME type

The commonly used MIME types are as follows. You can choose different types when uploading different files.

.doc application/msword
.docx application/
vnd.openxmlformats-officedocument.wordprocessingml.document
.pdf application/pdf
.xls application/vnd.ms-excel application/x-excel
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.ppt application/vnd.ms-powerpoint
.pptx application/
vnd.openxmlformats-officedocument.presentationml.presentation
.txt text/plain
.png image/png

Special reminder

Enter cookies and other information into the http header information. Never enter content-type as multipart/form-data here, because Use multipart/form-data for POST has been checked in the request (Note: If content-type as multipart/form-data is entered here, then all parameters will be transferred as files in binary form, and the text format parameters in our parameter will not be recognized, and the interface will prompt that those parameters are empty)

Intelligent Recommendation

Multipart / form-data POST file upload Detailed

theory Simple HTTP POST We sent via HTTP POST request to the server to submit data, are submitted by the expression form, as follows: Such data will be issued (irrelevant portion has been removed head...

AngularJs implement Multipart/form-data file upload

Due to the needs of the company, we have shifted from the traditional JSP in the Java backend to use a completely separated frontend and backend for development. The background fully provides an inter...

Multi-file upload multipart/form-data

Preface Uploading files in web development is relatively simple. An ordinary post form can be completed by adding file type tags. The uploading work is done by the browser. But when uploading files on...

File upload-processing data in the form of MultiPart

1. Configure the multipart parser (inject the implementation class) DispatcherServlet does not implement any function of parsing multipart request data. It delegates the task to the implementation of ...

JSP file upload enctype="multipart/form-data"

problem When uploading files, the form needs to be set enctype="multipart/form-data", that is: At this time, if there are other types of content in the form in addition to the file, the requ...

More Recommendation

Upload file multipart/form-data description

Upload file multipart form-data boundary description Meaning ENCTYPE="multipart/form-data" Description: Upload files through http protocol rfc1867 protocol overview, the client sends content...

Multipart/form-data and httpclient file upload

Written in front: The content discussed in this article is based on the Java technology stack. File upload is a relatively common functional requirement whether it is developed in the traditional HTML...

Data in the form of Multipart in SpringMVC (file upload)

1. The jar package required for file upload Raw servlet Processing uploaded data data, springmvc ⼜ ⼜ ⼜ serlvet Packaging, RequiredjarBag two. Configuration piece upload parser three.front endForm Four...

GO transit file Upload Multipart/Form-Data;

A slightly large project may have a transit project. Today I will say that the files encountered when uploading the transfer of the transit. If you use the post request directly as a transit, you will...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top