注意 - 我检查了BlazeMeter Tutorial,它将doc作为Body Data上载,而我使用File Upload选项卡。使用JMeter将文件上载到rest API
这里是我的要求的样子 -
在执行我获得以下请求 -
POST https://xxx
POST data:
<actual file content, not shown here>
[no cookies]
Request Headers:
Connection: keep-alive
Content-Type: multipart/form-data
Accept-Language: en-US
Authorization: bearer <>
Accept: application/json
Content-Length: 78920
Host: test-host
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)
和请求失败,400错误 -
Response code: 400
Response message: Bad Request
由于我能够使用curl进行文件上传,我假设我错了d使用JMeter进行一些配置。卷曲看起来像 -
curl -X POST --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --header 'Authorization: Bearer <>' -F [email protected]"test.pdf" 'https://xxx'
我在JMeter文件上传中错过了什么?
我也曾尝试用MIME类型'''多部分/形式data'''但无济于事 – Tarun