title: c# - How to Add Post Comment in LinkedIn?
body: <p>I'm trying to add post comment in LinkedIn for the past one week</p>
  
  <p>I've written this code</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          string xmlContent = "&lt;?xml version='1.0' encoding='UTF-8'?&gt;";
          xmlContent += "&lt;comment&gt;&lt;text&gt;Check out&lt;/text&gt;&lt;/comment&gt;";
          byte[] databytes = Encoding.Default.GetBytes(xmlContent);
  
          var credentials = new Hammock.Authentication.OAuth.OAuthCredentials
          {
              Type = OAuthType.AccessToken,
              SignatureMethod = OAuthSignatureMethod.HmacSha1,
              ParameterHandling = OAuthParameterHandling.HttpAuthorizationHeader,
              ConsumerKey = "*********",
              ConsumerSecret = "*********",
              Token = "*********",
              TokenSecret = "*********",
              Version = "1.0"
          };
  
          var client = new Hammock.RestClient() { Authority = "http://api.linkedin.com/v1/posts" };
          var request = new Hammock.RestRequest() { Path = "/56787878/comments", Method = Hammock.Web.WebMethod.Post, Timeout = new TimeSpan(0, 0, 5), Credentials = credentials };
          request.AddHeader("Content-Type", "application/xml");
          client.AddParameter("","");
          client.AddPostContent(Encoding.UTF8.GetBytes(xmlContent));
          //request.AddPostContent(Encoding.UTF8.GetBytes(xmlContent));
          var response = client.Request(request);
          Response.Write(response.Content);
       }
  </code></pre>
  
  <p>I get an error in the below Xml format</p>
  
  <pre><code> &lt;?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?&gt;
   &lt;error&gt;  
   &lt;status&gt;400&lt;/status&gt;
   &lt;timestamp&gt;1374494502579&lt;/timestamp&gt;
   &lt;request-id&gt;QM4MYPEKJJ&lt;/request-id&gt;  
   &lt;error-code&gt;0&lt;/error-code&gt;
   &lt;message&gt;Couldn't parse message document: error: Unexpected end of file after null&lt;/message&gt;\n&lt;/error&gt;
  </code></pre>
  
  <p>Anybody handle this error? Thanks in advance.</p>