title: How do I post to GitHub API v3
body: <p>I am using GitHub API v3 with C#. I am able to get the access token and using that I am able to get the user information and repo info.</p>
  
  <p><strong>But when I try to create a new repo I am getting the error as Unauthorized.</strong></p>
  
  <p>I am using HttpWebRequest to post data, which can be seen below. Please suggest me some C# sample or sample code.</p>
  
  <pre><code>(..)string[] paramName, string[] paramVal, string json, string accessToken)
  {
      HttpWebRequest req = WebRequest.Create(new Uri(url)) as HttpWebRequest;
      req.Method = "POST";
      req.ContentType = "application/json";
  
      StreamWriter writer = new StreamWriter(req.GetRequestStream());
      writer.Write(json);
      writer.Close();
  
      string result = null;
      using (HttpWebResponse resp = req.GetResponse() as HttpWebResponse)
      {
          StreamReader reader =
              new StreamReader(resp.GetResponseStream());
          result = reader.ReadToEnd();
      }(..)
  </code></pre>
  
  <p>Note: I am not sure where i need to add the accesstoken. I have tried in headers as well as in the url, but none of them works. </p>