Jmeter手动文件上传发布请求

经过大约一个星期的争取,以获得旧的ASP.net网站接受多部分表单发布请求我终于得到了 它可以解决这个问题,即Jmeters多部分表单函数对于这个站点没有正常工作,所以现在我必须在Body中手动编写Post请求。 但问题再次出现在上传文件部分。 我能够上传empy .txt文件,但我无法上传.png .jpeg我认为我做错了什么。 我在一个网站上读到我应该以某种方式使用_FileToString上传现有文件,但我不知道我应该怎么做。

完整的POST请求图像 </ p>

\ n

WebKitFormBoundaryBbo97BWEj5UehRpp
Content-Disposition:form-data; name =“ctl00 $ ContentPlaceHolder1 $ 8 $ 9 $ fu_appDocument $ fu_document”;
filename =“StacktraceKnijki.png”
Content-Type:image / png </ p>
</ blockquote>

Can Can 有人帮我把它变成一个工作的上传文件请求? 谢谢。</ p>
</ div>

展开原文

原文

after strugelling for about a week to get an old ASP.net site to accept a multipart form Post request I finally got it to work with a bit of a work around the trick is that Jmeters multipart form functionallity wasnt working properly for this site, so now i have to write the Post request in the Body manually. But the problem is again on the upload file part. I am able to upload empy .txt files but i am unable to upload .png .jpeg i susspect that i am doing something wrong. I read on a site that i am supposed to use _FileToString somehow to upload an existing file but i have no idea how i am supposed to do that. Full POST request image

WebKitFormBoundaryBbo97BWEj5UehRpp Content-Disposition: form-data; name="ctl00$ContentPlaceHolder1$8$9$fu_appDocument$fu_document"; filename="StacktraceKnijki.png" Content-Type: image/png

Can someone help me turn this into a working upload file request? Thank you.

1个回答



为什么不用JMeter的 HTTP(S)测试脚本记录器? JMeter应该足够聪明,可以从捕获的请求中生成相关的 HTTP请求采样器 。 </ p>

唯一的先决条件是在录制过程中将您的 StacktraceKnijki.png </ code>文件放在JMeter的“bin”文件夹中,参见使用JMeter录制文件上载指南了解更多详情。 </ p>
</ div>

展开原文

原文

Why don't you just record the file upload request using JMeter's HTTP(S) Test Script Recorder? JMeter should be smart enough to produce the relevant HTTP Request sampler from the captured request.

The only pre-requisite is having your StacktraceKnijki.png file in JMeter's "bin" folder during the recording process, see Recording File Uploads with JMeter guide for more details.

doutangguali32556
doutangguali32556 正如我所说,我有一些jmeter代理问题,解决方法是手动编写Body,请参阅更多信息-stackoverflow.com/questions/45144842 / ...
接近 3 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问