1. Content-Type: multipart / form-data for http upload attachments; in this article, first fetch the request through fiddler, and then simulate the request through jmeter. If there is an interface document, you can skip the step of capturing packets.
2. We first copy the header information into jmeter.
3 Copy the information of webforms in fiddler to the parameters of the http request of jmeter. Note: the name of the parameters only retains the name value of the webforms in fiddler. Compare the following figure with the one in step 1 and check Use multipart / form-data And Browser-compatible headers.
4. Delete the name = file copied in step three, click files upload, and place it under this item. The MIME type selects the Content-Type value of the line captured by webforms in fiddler: video / mp4
5. The last step is very important, click on the advanced option of the jmeter request and select implementation as java
Upload files or audio (any binary mime type)
For uploading audio interfaces, audio and pictures are all files. In the “Files Upload” panel of the parameter setting in the Jmeter tool, you can set the uploaded files;
At the file name: fill in the absolute path of the uploaded file,
Parameter name: fill in file
MIME type: application / octet-stream
Question 1: What is the MIME type?
MIME (Multipurpose Internet Mail Extensions) multi-purpose Internet mail extension type. Is to set some kind of extension of the file with one application type to open the way, when the extension of the file being accessed, the browser will automatically use the designated application to open. Used for a specified number of clients to customize the file name , and some media files Open. It is an Internet standard that extends the email standard to enable it to support:
Non-ASCII character text; non-text format attachments (binary, sound, image, etc.); message body composed of multiple parts; header information containing non-ASCII characters.
Question 2: What are the MIME types?
Each MIME type is composed of two parts. The front is a large category of data, such as audio and image, and the specific types are defined later. Common MIME types (universal types) have the following categories:
Hypertext markup language text.html text / html
xml text frame .xml text / xml
XHTML sentence frame .xhtml application / xhtml + xml
Plain text.txt text / plain
RTF text.rtf application / rtf
PDF document.pdf application / pdf
Microsoft Word file. Word application / msword
PNG图像 .png image/png
GIF graphics.gif image / gif
JPEG figure .jpeg, .jpg image / jpeg
au sound file .au audio / basic
MIDI music files mid, .midi audio / midi, audio / x-midi
RealAudio music files .ra, .ram audio / x-pn -realaudio
MPEG文件 .mpg,.mpeg video/mpeg
AVI file .avi video / x-msvideo
GZIP file .gz the Application / the X--gzip
TAR file .tar application / x-tar
Arbitrary binary data application / octet-stream
In the actual application process, we can fill in the MIMI type according to the specific file we want to upload