You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Tarun Kumar Bhadauria <ta...@raisin.com> on 2016/09/20 08:51:04 UTC

File upload results in 404 error

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

Re: File upload results in 404 error

Posted by Deepak Shetty <sh...@gmail.com>.
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.bhadauria@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
>