title: NSMutableURLRequest: posting large amounts of data
body: <p>I need to send large amounts of data (image files) by POST in a <code>WebView</code>, so I'm using <code>NSMutableURLRequest</code> with <code>setHTTPBody:</code>.</p>
  
  <p>Problem: if the data size is more than about 3MB, the app suddenly starts eating up huge amounts of memory and gets dog slow with all the paging.</p>
  
  <p>I've tried changing this:</p>
  
  <pre><code>[request setHTTPBody:[NSData dataWithBytes:post.Get() length:post.Size()]];
  </code></pre>
  
  <p>..to this:</p>
  
  <pre><code>[request setHTTPBodyStream:[NSInputStream inputStreamWithData:
      [NSData dataWithBytes:post.Get() length:post.Size()]]];
  </code></pre>
  
  <p>..but then nothing seems to happen and the request just times out. I get none of the normal callbacks (like <code>WebViewProgressEstimateChangedNotification</code>) and the data doesn't seem to get set.</p>
  
  <p>So, how do I (a) make the <code>NSData</code> approach not be a memory hog or (b) make the stream approach work (assuming it's a good workaround)?</p>