I'm trying to read the data of an application, where I send the information via get, Error: Can not send content with this type of verb.
public string ConsultaPedido(string urlpedido, string NumeroPedido)
{
var request = (HttpWebRequest)WebRequest.Create(urlpedido + "/" + NumeroPedido +"/");
request.ContentType = "application/json";
request.Method = "GET";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
string json = new JavaScriptSerializer().Serialize(new
{
AuthToken = "8686330657058660259"
});
streamWriter.Write(json);
}
var response = (HttpWebResponse)request.GetResponse();
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
return streamReader.ReadToEnd();
}
}