title: Apache benchmark multipart/form-data
body: <p>i'm facing a strange problem with apache benchmark post file. </p>
  
  <p>I need to stress a feature that handles file upload. So, I googled about, and found a post describing how to build a post file properly. Its contents looks like:</p>
  
  <pre><code>--1234567
  Content-Disposition: form-data; name="user_id"
  
  3
  --1234567
  Content-Disposition: form-data; name="file"; filename="cf_login.png"
  Content-Type: image/png
  
  [base64 encoded file content]
  --1234567--
  </code></pre>
  
  <p>The ab line is this:</p>
  
  <pre><code>$ ab -c 1 -n 5 -v 4 -T 'multipart/form-data; boundary=1234567' -p post_file.txt http://localhost:3000/files
  </code></pre>
  
  <p>When ab make the requests the generated header is the following:</p>
  
  <pre><code>INFO: POST header == 
  ---
  POST /files.json/ HTTP/1.0
  Content-length: 229
  Content-type: multipart/form-data; boundary=simpleboundary
  Host: localhost:3000
  User-Agent: ApacheBench/2.3
  Accept: */*
  
  
  ---
  LOG: header received:
  HTTP/1.1 500 Internal Server Error 
  Content-Type: text/html; charset=utf-8
  Content-Length: 13265
  X-Request-Id: 9ad57d19cd71886a1bb817d00fac651b
  X-Runtime: 0.015504
  Server: WEBrick/1.3.1 (Ruby/1.9.3/2012-04-20)
  Date: Tue, 25 Sep 2012 13:54:29 GMT
  Connection: close
  </code></pre>
  
  <p>The expected return is a raise params.inspect, that let me see if the data is arriving to the other side. If I remove the boundary I can see data received in params, but this is not what I want. I want to get a file upload.</p>
  
  <p>Anyone has a tip? I will really appreciate it.</p>