title: C# Restful Client
body: <p>I have Implemented C# Restful Service and the service is running fine with this URL:
  htp://port/restfulService.svc/json/?id=SHAKEEL"
  and Result in Browser is:
  Your Requested XML Product is :shakeel
  I want to use this service for with the help of a Console Client, for that i implemented the following but not working, and IN result it is returning,
  <b>Cannot send a Content-Body with this verb type</b>,
  please provide me suggestions that may lead me to Solution.
  Thanks.</p>
  
  <pre><code>static void Main(string[] args)
  {
      do
      {
          try
          {
              string uri = "http://port/restfulService.svc/json/id=SHAKEEL";
              HttpWebRequest req = WebRequest.Create(uri) as HttpWebRequest;
              req.KeepAlive = false;
              req.ContentLength = 0;
              req.ContentType = "text/xml";
              Stream data = req.GetRequestStream();
              data.Close();
  
              string result;
              using (WebResponse resp = req.GetResponse())
              {
                  using (StreamReader reader = new StreamReader(resp.GetResponseStream()))
                  {
                      result = reader.ReadToEnd();
                  }
              }
              result = result.Substring(1, result.Length - 2);
              Console.WriteLine(result);
          }
          catch (Exception ex)
          {
              Console.WriteLine(ex.Message.ToString());
          }
          Console.WriteLine();
          Console.WriteLine("Do you want to continue?");
      } while (Console.ReadLine() == "Y");
  }
  </code></pre>