得到错误“由于未找到多部分边界而拒绝了该请求".在Jmeter中上传文件时 [英] Getting error "the request was rejected because no multipart boundary was found" while uploading the file in Jmeter

查看:189
本文介绍了得到错误“由于未找到多部分边界而拒绝了该请求".在Jmeter中上传文件时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将文件上传到jmeter:

请找到我在请求中传递的以下提及的详细信息,

Http请求:

POST: http:${server_name}/attachment

1.File Path : D:\localdrive\test_docs\images.jpg 2.Parameter Name:images.jpg 3.MIME Type:image/jpg

Http标头:

1.Accept :  / ,
2.Content-Type :    multipart/form-data

响应数据:

 {"response":"the request was rejected because no multipart boundary was found"}

任何人都可以在同一位置共享解决方案.

解决方案

知道了!

确保在HTTP请求中应提及以下参数.

  1. 实现应为HttpClient3.1或Java(请勿空白)
  2. 内容编码:UTF-8
  3. 应检查HTTP示例中的为发布使用多部分/表单数据".
  4. 在HTTP标头中(Content-Type:multipart/form-data)
  5. 对于参数名称& MIME类型 例如在浏览器中输入F12&达到要求 请参阅网络"标签中的内容: 在参数内部,您将获得请求参数 例如,如果param是: HTML contains = Content-Disposition:form-data; name =文件"; filename ="images.jpg"内容类型:image/jpeg

然后参数名:file& MIME类型:image/jpeg应该是这样的.

&现在它的工作正常,这对我来说是一个很大的安慰!

也感谢安德斯(Anders)的回答.

I have tried to upload the file in jmeter:

Please find below mentioned details which i passed in request,

Http reuest:

POST: http:${server_name}/attachment

1.File Path : D:\localdrive\test_docs\images.jpg 2.Parameter Name:images.jpg 3.MIME Type:image/jpg

Http Header :

1.Accept :  / ,
2.Content-Type :    multipart/form-data

Response Data :

 {"response":"the request was rejected because no multipart boundary was found"}

could anyone please share the solution on the same .

解决方案

Got it !!!

Make sure that below parameter should be mentioned in HTTP request.

  1. Implementation should be HttpClient3.1 or Java (Don't keep it blank)
  2. Content encoding :UTF-8
  3. "Use multipart/form-data for Post" in HTTP sample should be checked.
  4. In HTTP header (Content-Type : multipart/form-data)
  5. for Parameter-name & MIME-type e.g. In browser enter F12 & hit the request , refer the content in Network tab : Inside Param u will get request param for example if param is : HTML contains= Content-Disposition: form-data; name="file"; filename="images.jpg" Content-Type: image/jpeg

Then Parameter-name :file & MIME-type :image/jpeg should be like this.

& now its work fine ,That's a great relief for me !!!

also thanks Anders for ur answer.

这篇关于得到错误“由于未找到多部分边界而拒绝了该请求".在Jmeter中上传文件时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆