带文件的Jmeter REST多部分POST

时间:2013-10-18 15:47:59

标签: json jmeter multipart

我一直试图找出如何发布json http请求。 没有找到明确回答问题的任何SO主题,所以我以不同的形式重新发布

我已使用Accept: application/json ; Content-Type: Application/json; Content-Dispositions: attachment

设置HTTP标头管理器

我已将原始正文数据设置为

{ "post":   {"title":"Hello", "file": "${myfile.pdf}" } }

我还在列表中添加了一个文件,参数名为myfile.pdf,mime-type:application / pdf

当我检查使用JMeter代理生成的请求时,我似乎在请求中获得的是pdf文件,而没有JSON请求......

我可能做错了什么?

1 个答案:

答案 0 :(得分:0)

我宁愿在HTTP请求方法中选择POST,只需将以下内容粘贴到HTTP请求参数值中,而不提供参数名称

{"title":"Hello", "file": "${myfile.pdf}" }
相关问题