title: composing form data with HttpClient
body: <p>I want to send form data to my webserver from a Windows Phone 8 application. The data contains a file to upload and additional some strings (key=value).</p>
  
  <p>The composing and sending of the file works fine. But how can I add now my strings to the send content?</p>
  
  <pre><code>string mServerUrl = @"http://www.myserver/reveiver.asp";
  _ImageMemoryStream.Position = 0;
  MultipartFormDataContent content = new MultipartFormDataContent();
  content.Add(CreateFileContent(_ImageMemoryStream, "uploadedphoto.jpg", "image/jpeg"));
  
  HttpClient mHttpClient = new HttpClient();
  HttpResponseMessage mResponse = null;
  mResponse = await mHttpClient.PostAsync(mServerUrl, content);
  string responseBodyAsText = await mResponse.Content.ReadAsStringAsync();
  if (mResponse.StatusCode == HttpStatusCode.OK)
  {
      txtError.Text = "OK:" + responseBodyAsText;
  }
  else
  {
      txtError.Text = "ERROR (" + mResponse.StatusCode + "):\n" + mResponse.ReasonPhrase;
  }
  </code></pre>
  
  <p>Helper for composing the file:</p>
  
  <pre><code>private StreamContent CreateFileContent(Stream stream, string fileName, string contentType)
  {
      var fileContent = new StreamContent(stream);
      fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
      {
          Name = "\"file\"",
          FileName = "\"" + fileName + "\""
      };
      fileContent.Headers.ContentType = new MediaTypeHeaderValue(contentType);
      return fileContent;
  }
  </code></pre>
  
  <p>Adding my key/value pair in this way doesn´t fit:</p>
  
  <pre><code>content.Add("key", "value");
  </code></pre>
  
  <p>I want to add to my form-data some of These pairs ... Any help?</p>