title: Using HttpClient Class with WinRT
body: <p>I have a Piece of code which works perfect in .NET (4.0)</p>
  <h1>Code#</h1>
  <pre><code>        string URI = &quot;http://www.indianrail.gov.in/cgi_bin/inet_pnrstat_cgi.cgi&quot;;
          string Parameters = Uri.EscapeUriString(&quot;lccp_pnrno1=8561180607&amp;amp;submitpnr=Get Status&quot;);
          System.Net.HttpWebRequest req = (HttpWebRequest)System.Net.WebRequest.Create(URI);
          //HTTP POST Headers
          req.ContentType = &quot;application/x-www-form-urlencoded&quot;;
          req.Host = &quot;www.indianrail.gov.in&quot;;
          //You can use your own user-agent.
          req.UserAgent = &quot;Mozilla/5.0 (compatible; MSIE 7.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0) DELL;Venue Pro&quot;;
          req.Headers.Add(HttpRequestHeader.AcceptLanguage, &quot;en-us,en;q=0.5&quot;);
          req.Headers.Add(HttpRequestHeader.AcceptCharset, &quot;ISO-8859-1,utf-8;q=0.7,*;q=0.7&quot;);
          req.KeepAlive = true;
          req.Referer = &quot;http://www.indianrail.gov.in/pnr_stat.html&quot;;
          req.Accept = &quot;text/plain&quot;;
          req.Method = &quot;POST&quot;;
          //Byte size calculation before sending request.
          byte[] bytes = System.Text.Encoding.ASCII.GetBytes(Parameters);
          req.ContentLength = bytes.Length;
          System.IO.Stream os = req.GetRequestStream();
          os.Write(bytes, 0, bytes.Length);
          os.Close();
          System.Net.WebResponse resp = req.GetResponse();
          var request_status = ((HttpWebResponse)resp).StatusDescription;
          if (resp == null) return;
          System.IO.StreamReader sr = new System.IO.StreamReader(resp.GetResponseStream());
          Console.WriteLine(sr.ReadToEnd());
          Console.ReadLine();  
  </code></pre>
  <p>I just cant Seem to figure out what to write in Win Store apps</p>
  <p>SO far i have got to which class i have to use (or may be not)</p>
  <pre><code>HttpClient httpClient = new HttpClient();
  
  httpClient.DefaultRequestHeaders.Add(&quot;Host&quot;, &quot;www.indianrail.gov.in&quot;);  
  </code></pre>
  <p>But what about the other values there are some header in which we can add some data ,some are there which need to be added to the collection (DefaultHeaders) directly...</p>
  <p>Is there any documentation for usage and  description for the same</p>
  <p>ANy help in this direction will be great :)</p>