Created attachment 34160 [details] 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.
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
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.
(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
(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: ______________________________________________________________________________
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?
(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.
This should be fixed within Bug 62260
*** This bug has been marked as a duplicate of bug 62260 ***
(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.
Hello, Issue is fixed, tests and feedback are very welcome Thanks
*** Bug 56197 has been marked as a duplicate of this bug. ***
*** Bug 57188 has been marked as a duplicate of this bug. ***
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4066