I found that using HTTP Request Implementation - HTTPClient4 was causing the error 400. I changed it to java and error disappeared.
On 24 September 2016 at 04:21, Deepak Shetty <shet...@gmail.com> wrote: > run curl with -v and compare (visually , not sure if the Authorization > header is case senstive) > > On Tue, Sep 20, 2016 at 1:51 AM, Tarun Kumar Bhadauria < > tarun.kumar.bhadau...@raisin.com> wrote: > > > Hello All, > > > > I am trying to convert following curl request to JMeter call - > > > > curl -X POST --header 'Content-Type: multipart/form-data' --header > 'Accept: > > application/json' --header 'Authorization: Bearer <xxx>' -F > > upload_file=@"test.pdf" 'https://xxx' > > > > And this is how JMeter request looks as - > > > > http://i.stack.imgur.com/c9X1U.png > > > > And this is what I get from Request tab of View Results in Tree - > > > > *POST https://xxx <https://xxx>* > > *POST data:* > > *--ZRdmcvkfYjxrM3FEDal6NGOFIdjm1F0* > > *Content-Disposition: form-data; name="upload_file"; filename="test.pdf"* > > *Content-Type: multipart/form-data* > > > > *<actual file content, not shown here>* > > *--ZRdmcvkfYjxrM3FEDal6NGOFIdjm1F0--* > > > > > > *[no cookies]* > > > > *Request Headers:* > > *Connection: keep-alive* > > *Content-Type: multipart/form-data* > > *Accept-Language: en-US* > > *Authorization: bearer <xxx>* > > *Accept: application/json* > > *Content-Length: 79104* > > *Host: <host>* > > *User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)* > > > > > > But the I get 400 status code as result of call. Given that curl work, > what > > do I do wrong with JMeter request? > > > > Thanks > > Tarun K > > >