title: status code 400 with no error object when uploading to box
body: <p>I'm trying to use the <code>request.js</code>library to upload a file to box.com using request.post.</p>
  
  <p>I consistently get a return code of 400 and a null body in the response. Not sure how to get at the actual error that box is seeing. The <code>err</code> argument to the callback is null, so there is a response from box.com, but with a statuscode of 400 and a null body.</p>
  
  <p>FYI, the upload succeeds using curl, so the auth token etc. is fine.
  I pointed the function below to <a href="http://echo.200please.com" rel="nofollow">http://echo.200please.com</a>', and it seems the HTTP POST request I'm sending out is fine.
  How do I get to see what error is being seen by box?</p>
  
  <pre><code>request = require"request");
  UploadFile = function(filename, callback) {
      var formData = {
          attributes: JSON.stringify( {
              name: filename, 
              parent: { id: '' + 2764913765 }
          }),
          file: fs.createReadStream('./temp.bin')
      }
      var options = {
          url: 'https://upload.box.com/api/2.0/files.content', 
          headers: { Authorization: 'Bearer ' + tokens.access_token},
          formData: formData
      }
  
      request.post(options,
                   function(err, response, body) {
          if (err) {
              console.log('Error Uploading the file');
          } else {
              console.log('returned:' + body + JSON.stringify(response.headers))
          }
      });
  </code></pre>
  
  <p>If I change the URL to point to echo.200please.com, the response I get from echo.200please.com is below, which seems to be the correct format for a file upload request.</p>
  
  <pre><code>&gt; POST / HTTP/1.0
  Host: echo.200please.com
  Connection: close
  Content-Length: 1951
  Authorization: Bearer bVPDzG8PgIVRNoqb5LOzD61h6NXhJ6h0
  content-type: multipart/form-data; boundary=--------------------------799592280904953105406767
  
  ----------------------------799592280904953105406767
  Content-Disposition: form-data; name="attributes"
  
  {"name":"testchunkname.1","parent":{"id":"2764913765"}}
  ----------------------------799592280904953105406767
  Content-Disposition: form-data; name="file"; filename="temp.bin"
  Content-Type: application/octet-stream
  
  &lt;... file data ...&gt;
  </code></pre>