Http Request Sampler for RESTFul call - uploading multipart/form-data failed -- missing start boundary

5,643 views
Skip to first unread message

Max Shen

unread,
Sep 5, 2013, 4:01:03 PM9/5/13
to jmeter-...@googlegroups.com
Trying to use http request sampler to invoke restful svc call and upload a file as multipart/form-data.

Here is the request log
POST [url removed]

POST data:
--EDHfpU--q5a4ZKL4ARKEcJCOmTF8P8b9
Content-Disposition: form-data; name=""; filename="10trxinput.tsv.gz"
Content-Type: multipart/form-data

<actual file content, not shown here>
--EDHfpU--q5a4ZKL4ARKEcJCOmTF8P8b9--


[no cookies]

Request Headers:
Connection: keep-alive
Content-Type: multipart/form-data;charset=UTF-8
Accept-Encoding: gzip,deflate,sdch
Content-Length: 1901
Host: [host removed]
User-Agent: Apache-HttpClient/4.2.3 (java 1.5)

Here is the response
 Missing start boundary

 And I tried the same request and same file in chrome extension Advanced Rest Client and captured the log. I found in the header and the payload, both of them have the same boundary value.
However in the request Jmeter made, the header doesn't have boundary parameter.

Any idea?


  1. Request URL:
    [URL removed]
  2. Request Method:
    POST
  3. Status Code:
    200 OK
  4. Request Headersview source
    1. Accept:
      */*
    2. Accept-Encoding:
      gzip,deflate,sdch
    3. Accept-Language:
      en-US,en;q=0.8,zh-CN;q=0.6
    4. Connection:
      keep-alive
    5. Content-Length:
      1922
    6. Content-Type:
      multipart/form-data; boundary=----WebKitFormBoundaryBTKuZgvohaK68xRA
    7. Cookie:[cookie removed]
    8. Host:
      [host removed]
    9. Origin:
      chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
    10. User-Agent:
      Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.57 Safari/537.36
  5. Request Payload
    1. ------WebKitFormBoundaryBTKuZgvohaK68xRA Content-Disposition: form-data; name="fileUpload"; filename="10trxinput.tsv.gz" Content-Type: application/x-gzip ------WebKitFormBoundaryBTKuZgvohaK68xRA--

Max Shen

unread,
Sep 11, 2013, 1:19:58 PM9/11/13
to jmeter-...@googlegroups.com
Okay.... I changed the Implementation from default to HttpClient3.1, it starts working.....

Issue resolved

rjh...@gmail.com

unread,
Aug 8, 2014, 12:10:24 PM8/8/14
to jmeter-...@googlegroups.com
how did you post the body content in HTTP Request?  a gxip file would be byte data (I think), and the only I could manage is manipulating the Body Data is via string.  this means the data is corrupted.

bala...@gmail.com

unread,
Oct 21, 2015, 8:08:17 PM10/21/15
to jmeter-plugins
Thanks Max Shen for posted your solution. I faced the same problem .. I changed to HttpClient3.1. It started working.

chet...@gmail.com

unread,
Sep 9, 2016, 7:21:28 AM9/9/16
to jmeter-plugins

chet...@gmail.com

unread,
Sep 9, 2016, 7:23:24 AM9/9/16
to jmeter-plugins
Hi i am using the plupload for uploading the file. when i debug and see in the HttpRequest.Files.count=0 means there is no file.
can u plz tell me how to do that in Jmeter

gli...@gmail.com

unread,
Sep 13, 2016, 1:36:56 AM9/13/16
to jmeter-plugins, chet...@gmail.com
The "recipe" is the same as for any other JMeter mimicking task:

  1. Record your request
  2. Perform correlation and parametrisation
  3. Replay your request
  4. If point 3 isn't successful - compare real request send by browser and the request coming from JMeter with a sniffer tool like Wireshark. Tweak JMeter until requests are absolutely the same (some parameters may differ though, i.e. timestamps, cookies, multipart boundaries, etc.)

Coming back to RESTful Web Service and multipart upload bit, check out Testing REST API File Uploads in JMeter article, it provides comprehensive instructions on how to send "mixed" JSON and multipart requests.

saritad...@gmail.com

unread,
Sep 16, 2016, 7:56:22 AM9/16/16
to jmeter-plugins, chet...@gmail.com, gli...@gmail.com
Hi..
Thanks for the reply
I am using Plupload for uploading.. I need to pass the content from the request payload.. how can I do that..

vanamul...@gmail.com

unread,
Apr 18, 2019, 4:25:02 AM4/18/19
to jmeter-plugins
Thanks , Even it worked for me when changed to older version of Jmeter with HttpClient3 - 
Reply all
Reply to author
Forward
0 new messages