title: Web API Batch requests failing in Postman
body: <p>I recently added batch request support to my Web API project, and spent the better part of a day trying to debug why the batch request was failing using Postman: <code>Unexpected end of MIME multipart stream. MIME multipart message is not complete.</code></p>
  
  <p>After searching around for quite a while, and learning all about the <a href="https://stackoverflow.com/questions/13770536/asp-net-web-api-unexpected-end-of-mime-multi-part-stream-when-uploading-from-fl">trailing CRLF issue</a>, I finally wrote a quick C# console app using <code>System.Net.Http</code> similar to the example given <a href="https://aspnetwebstack.codeplex.com/wikipage?title=Web%20API%20Request%20Batching" rel="nofollow noreferrer">here</a>.  This worked great!</p>
  
  <p><strong>My question is:</strong> what is Postman doing differently that makes my batch requests fail?
  Using fiddler to capture the requests, and then using winmerge to diff them, the only difference is the Postman request contains a few additional headers:</p>
  
  <pre><code>User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
  Cache-Control: no-cache
  Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
  Accept: */*
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  </code></pre>
  
  <p>I tried adding those headers to my console app to make the requests exactly the same, and it still worked in my console app, but failed in Postman!  </p>
  
  <p>Anyone have any idea <strong>WHY</strong>?</p>
  
  <hr>
  
  <p>Fiddler-captured requests below:</p>
  
  <p><strong>POSTMAN:</strong></p>
  
  <pre><code>POST http://localhost:49402/api/sequentialBatch HTTP/1.1
  Host: localhost:49402
  Connection: keep-alive
  Content-Length: 528
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
  Cache-Control: no-cache
  Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  Authorization: Basic c2E6c2E=
  Content-Type: multipart/mixed; boundary="c3581ff4-f6eb-4c41-ac02-0bb8b80b30ef"
  Accept: */*
  Accept-Encoding: gzip,deflate,sdch
  Accept-Language: en-US,en;q=0.8
  
  --c3581ff4-f6eb-4c41-ac02-0bb8b80b30ef
  Content-Type: application/http; msgtype=request
  
  GET /api/currency?$filter=Currency_ID eq 'Z-US$' HTTP/1.1
  Host: localhost.fiddler:49402
  Authorization: Basic c2E6c2E=
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  
  --c3581ff4-f6eb-4c41-ac02-0bb8b80b30ef
  Content-Type: application/http; msgtype=request
  
  GET /api/countrycode/US HTTP/1.1
  Host: localhost.fiddler:49402
  Authorization: Basic c2E6c2E=
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  
  
  --c3581ff4-f6eb-4c41-ac02-0bb8b80b30ef--
  </code></pre>
  
  <p><strong>CONSOLE APP:</strong> (with additional postman headers)</p>
  
  <pre><code>POST http://localhost:49402/api/sequentialBatch HTTP/1.1
  Host: localhost:49402
  Connection: Keep-Alive
  Content-Length: 553
  User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
  Cache-Control: no-cache
  Origin: chrome-extension://fdmmgilgnpjigdojojpjoooidkmcomcm
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  Authorization: Basic c2E6c2E=
  Content-Type: multipart/mixed; boundary="cf2b18a3-5861-49d7-878b-142283cb4959"
  Accept: */*
  Accept-Encoding: gzip, deflate, sdch
  Accept-Language: en-US, en; q=0.8
  
  --cf2b18a3-5861-49d7-878b-142283cb4959
  Content-Type: application/http; msgtype=request
  
  GET /api/currency?$filter=Currency_ID%20eq%20'Z-US$' HTTP/1.1
  Host: localhost.fiddler:49402
  Authorization: Basic c2E6c2E=
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  
  
  --cf2b18a3-5861-49d7-878b-142283cb4959
  Content-Type: application/http; msgtype=request
  
  GET /api/countrycode/US HTTP/1.1
  Host: localhost.fiddler:49402
  Authorization: Basic c2E6c2E=
  Session-ID: 03317cfa-c051-4813-a02a-a9fa955cc7f5
  
  
  --cf2b18a3-5861-49d7-878b-142283cb4959--
  </code></pre>
  
  <p>I did notice one difference: in Postman the <code>Content-Length</code> header changed from 553 (as posted) to 528 (when captured)... not sure if this is relevant to my issue or not...</p>