title: Should I use an HTTP/2 specific feature for a REST API that transforms a large file
body: <p><strong>The Situation</strong></p>
  <p>My team is creating an API that receives a large structured text file (100MB - 1TB, 1GB expected) and modifies each row and returns the resulting file. We can process the file as fast as it is transmitted, so would like to avoid caching the file on our servers. We favor ease-of-use for our clients over our own resource use, so this is not a hard requirement.</p>
  <p><strong>Some Options</strong></p>
  <p><a href="https://www.rfc-editor.org/rfc/rfc2616" rel="nofollow noreferrer">HTTP/1.1</a> implicitly requires that the full request be processed before the response is sent (<a href="https://stackoverflow.com/a/14483857/309334">except in the case of errors</a>) <a href="https://www.innovation.ch/java/HTTPClient/fullduplex.html" rel="nofollow noreferrer">and bad things can happen, especially with proxies, if you try to get around this</a>. So we were going to bite the bullet and store the request or response and use another resource in our organization for uploading large files for processing.</p>
  <p>HTTP/2 <a href="http://httpwg.org/specs/rfc7540.html#HttpSequence" rel="nofollow noreferrer">explicitly allows you to send before the request has finished and requires that the client read what you send</a> and HTTP/2 is already supported in all major browsers.</p>
  <p>So, I see a few potential apis (all POST):</p>
  <p>HTTP1.x: upload/download - there is already some infrastructure for this</p>
  <pre><code>/transformed_file_id/ --&gt; returns id for the uploaded file 
  /transformed_file/{id} --&gt; returns the transformed data
  </code></pre>
  <p>HTTP1.x: single request</p>
  <pre><code>/transformed_file/ --&gt; returns the transformed version of the file - stores stuff under-the-hood
  </code></pre>
  <p>HTTP2: single request</p>
  <pre><code>/transformed_file/ --&gt; returns the transformed version of the file - starts sending response as soon as it receives the first couple of K.
  </code></pre>
  <p><strong>The Question(s)</strong></p>
  <p>Though I wouldn't shy away from it for browser content, is it wise to use HTTP/2 for a service in order to access this feature?</p>
  <p>Or is all this a bad idea and clients should be forced to upload smaller parts of the file at a time (and we'll need to write a front-end to allow this on a browser-interface - which could be quite tough).</p>