title: REST file upload with HttpRequestMessage or Stream?
body: <p>What is the better way to upload a file for a REST client?</p>
  
  <p>From the WCF Web API Documentation</p>
  
  <pre><code>[WebInvoke(UriTemplate = "thumbnail", Method = "POST")]
  public HttpResponseMessage UploadFile(HttpRequestMessage request)
  {
  </code></pre>
  
  <p>From multiple forum posts:<br>
  <a href="https://stackoverflow.com/questions/7264503/wcf-rest-file-upload-with-additional-parameters">WCF REST File upload with additional parameters</a></p>
  
  <pre><code>[WebGet(UriTemplate="", Method ="POST"]
  public string UploadFile(Stream fileContents)
  </code></pre>
  
  <p>I understand, that the first method allows to directly post a file from a normal HTML form. The 2nd approach seems more common on all forum posts I find. </p>
  
  <p>What would you recommend and why? The REST api should be accessible from all kind of languages and platforms. </p>
  
  <p>For the HttpRequestMessage approach, how would I do an upload a file preferable with the WCF HttpClient? With the FormUrlEncodedMediaTypeFormatter)</p>