You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2016/08/18 14:31:46 UTC

[Bug 60015] New: HTTP PUT Request with multipart/form-data did not work with HTTPClient4

https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

            Bug ID: 60015
           Summary: HTTP PUT Request with multipart/form-data did not work
                    with HTTPClient4
           Product: JMeter
           Version: 3.0
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: kaluramghelot89@gmail.com

Created attachment 34160
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34160&action=edit
sample jmx test file that we are using

Unable to send the file as a multi-part/form data for PUT request using HTTP
Sampler with HTTPClient4.
Please find attached a sample jmx test for the same.

The equivalent cURL command for the same is :
curl --proxy http://our_proxyurl -v -4 -k -u username:somepass -X PUT -F
"file1=@C:\Users\tempuser\Desktop\temp\myfile.zip"
"https://some_servername//some_api/upload?project=projectname"

It works fine with this cURL command. And we receive a proper response.
We have tried using both jMeter v 2.13 and jMeter v 3.0.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] HTTP PUT Request with multipart/form-data did not work with HTTPClient4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

kaluramghelot89@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #2 from kaluramghelot89@gmail.com ---
Hi Philippe

We had already tried using the Authorization header as well. Still we were
facing the issue. 

I think the actual issue is that in case of PUT method there is no multipart
request is being sent, as we do for POST method. And that is what might be
causing the actual failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|HTTP PUT Request with       |Multipart/form-data works
                   |multipart/form-data did not |only for POST using
                   |work with HTTPClient4       |HTTPClient4 while it should
                   |                            |for PUT, DELETE...

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

--- Comment #7 from UbikLoadPack support <su...@ubikloadpack.com> ---
This should be fixed within Bug 62260

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] HTTP PUT Request with multipart/form-data did not work with HTTPClient4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

kaluramghelot89@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
                 CC|                            |kaluramghelot89@gmail.com

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

--- Comment #9 from Michael Osipov <19...@gmx.net> ---
(In reply to Philippe Mouawad from comment #8)
> 
> *** This bug has been marked as a duplicate of bug 62260 ***

This is not duplicate. This ticket depends on 62260. Please mark it as such.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Michael Osipov <19...@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #6 from Michael Osipov <19...@gmx.net> ---
(In reply to Nishit from comment #5)
> any updates on this. We are using jmeter for api testing in our project
> where we need to upload images using put request and we are not able to test
> it due to this issue. I am using jmeter 3.2 and in that multipart/form-data
> check box is disabled for put request.can somebody look into this issue?

I agree, this is an arbirary limitation. It is upto the client to decide to use
multipart/form-data with PUT or PATCH, etc. JMeter isn't a browser and
shouldn't have this limitation.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |62260
         Resolution|DUPLICATE                   |FIXED


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=62260
[Bug 62260] Improve Rest support
-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |shyshkotestmail@gmail.com

--- Comment #12 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 57188 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

--- Comment #10 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello,
Issue is fixed, tests and feedback are very welcome

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] HTTP PUT Request with multipart/form-data did not work with HTTPClient4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om
             Status|NEW                         |NEEDINFO

--- Comment #1 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Your issue is probably due to a known limitation of HC4 , see Bug 57242.

Can you disable Basic Auth on your server or pass a header (using Header
Manager):
Authorization : Basic <base64 encoded version of <username>:<password>>

Can you try this and give feedback ?
Thank you

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] HTTP PUT Request with multipart/form-data did not work with HTTPClient4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

--- Comment #4 from kaluramghelot89@gmail.com ---
(In reply to Philippe Mouawad from comment #3)
> (In reply to kaluramghelot89 from comment #2)
> > Hi Philippe
> > 
> > We had already tried using the Authorization header as well. Still we were
> > facing the issue. 
> > 
> > I think the actual issue is that in case of PUT method there is no multipart
> > request is being sent, as we do for POST method. And that is what might be
> > causing the actual failure.
> I don't understand as it works in my test with Http Mirror Server .
> Did you try using HttpClient 3.1 ?
> Thanks

We have not tried with HttpClient 3.1.
Although as a work around we are using the above mentioned cURL command using
the OS Process Sampler.

And are you sending multiple files with in your request? Also, would you please
share the request that gets created when you are testing. 

In our case the request that is getting created is somewhat similar to this:
______________________________________________________________________________
PUT https://somehost/api/upload?project=projectname

PUT data:
<actual file content, not shown here>

[no cookies]

Request Headers:
Connection: keep-alive
Authorization: Basic cnV***************************NQ==
Content-Type: multipart/form-data
Content-Length: 0
Host: somehost
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_101)
______________________________________________________________________________

And what we want is : 
______________________________________________________________________________
PUT /api/upload?project=projectname HTTP/1.1
Host: somehost
Authorization: Basic cnV*****************************NQ==
Cache-Control: no-cache
Content-Type: multipart/form-data;
boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename=""
Content-Type: 


------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name=""; filename=""
Content-Type: 
______________________________________________________________________________

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---


*** This bug has been marked as a duplicate of bug 62260 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Nishit <ns...@mobiquityinc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #5 from Nishit <ns...@mobiquityinc.com> ---
any updates on this. We are using jmeter for api testing in our project where
we need to upload images using put request and we are not able to test it due
to this issue. I am using jmeter 3.2 and in that multipart/form-data check box
is disabled for put request.can somebody look into this issue?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

UbikLoadPack support <su...@ubikloadpack.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |JMETER_4.1

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] HTTP PUT Request with multipart/form-data did not work with HTTPClient4

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

--- Comment #3 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to kaluramghelot89 from comment #2)
> Hi Philippe
> 
> We had already tried using the Authorization header as well. Still we were
> facing the issue. 
> 
> I think the actual issue is that in case of PUT method there is no multipart
> request is being sent, as we do for POST method. And that is what might be
> causing the actual failure.
I don't understand as it works in my test with Http Mirror Server .
Did you try using HttpClient 3.1 ?
Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 60015] Multipart/form-data works only for POST using HTTPClient4 while it should for PUT, DELETE...

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60015

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |56197
                 CC|                            |toogoodtopassup@gmail.com

--- Comment #11 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
*** Bug 56197 has been marked as a duplicate of this bug. ***


Referenced Bugs:

https://bz.apache.org/bugzilla/show_bug.cgi?id=56197
[Bug 56197] HTTP Request Component fails to Send File with the Request
-- 
You are receiving this mail because:
You are the assignee for the bug.