title: API Gateway - POST multipart/form-data
body: <p>It seems my question maybe a little similar <a href="https://stackoverflow.com/questions/41270871/api-gateway-encoding-multipart-form-data">to this one</a>.</p>
  <p>I have an API within my <code>API Gateway</code> and am doing a HTTP proxy through to an endpoint that POST's <code>multipart/form-data</code> files.</p>
  <p>If I call the HTTP endpoint directly (not through the <code>API gateway</code>) - using <code>postman</code>, it works as expected, however, using the API gateway endpoint (through <code>postman</code>) fails.</p>
  <p>I have compared both requests (through <code>fiddler</code> and <code>CloudWatch</code> logs) which seem to be identical:</p>
  <p>Request for direct API call (working):</p>
  <pre><code>POST https://domainname/api/v1/documents HTTP/1.1
  Host: api.service
  Connection: keep-alive
  Content-Length: 202
  Authorization: AuthToken
  Postman-Token: a75869d6-1d64-6b9f-513d-a80ac192c8e1
  Cache-Control: no-cache
  Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
  docMetaInfo: some extra data needed
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryB85rsPlMffA2fziS
  Accept: */*
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8
  
  ------WebKitFormBoundaryB85rsPlMffA2fziS
  Content-Disposition: form-data; name=&quot;&quot;; filename=&quot;Test.txt&quot;
  Content-Type: text/plain
  
  This is a test Text File
  ------WebKitFormBoundaryB85rsPlMffA2fziS--
  </code></pre>
  <p>Request from the API Gateway (not working):</p>
  <pre><code>POST https://GATEWAY_domainname/api/v1/documents HTTP/1.1
  Host: api-Gateway.service
  Connection: keep-alive
  Content-Length: 202
  Authorization: AuthToken
  Postman-Token: e25536fa-3dfa-ddcb-8ca6-3f3552d2bc40
  Cache-Control: no-cache
  Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
  docMetaInfo: some extra data needed
  User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundarybX9MyWBsuLGm6QIC
  
  x-api-key: *********************
  Accept: */*
  Accept-Encoding: gzip, deflate, br
  Accept-Language: en-US,en;q=0.8
  
  ------WebKitFormBoundarybX9MyWBsuLGm6QIC
  Content-Disposition: form-data; name=&quot;&quot;; filename=&quot;Test.txt&quot;
  Content-Type: text/plain
  
  This is a test Text File
  ------WebKitFormBoundarybX9MyWBsuLGm6QIC--
  </code></pre>
  <p>I have tried a few things from the gateway side, including changing the <code>Integration Request</code> to map a new body for the same content-type, no luck.</p>
  <p>As far as I am aware, I should only need to <code>passthrough</code> this call, hence why it's becoming a little confusing - there should be no need for data manipulation / interception?</p>
  <p>The error I get is 400 - bad request (complaining about the <code>file</code> not being found), but as you can see in the request, it's there.</p>
  <p>Any ideas?</p>
  <p><strong>EDIT</strong>
  Logs from CloudWatch on the same APIGateway POST</p>
  <p><a href="https://i.stack.imgur.com/eY4ex.png" rel="noreferrer"><img src="https://i.stack.imgur.com/eY4ex.png" alt="enter image description here" /></a></p>
  <p>Error is still 400 - no file found</p>