Reputation: 6451
I got bad request using the following Code :
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://xxxxxxx");
request.Headers.Add("xxxxxxxxxxxxxxxxx");
request.ContentType = "application/x-www-form-urlencoded ";
request.Method = "POST";
byte[] buf = Encoding.Default.GetBytes("sssssssssssssss");
request.ContentLength = buf.Length;
request.GetRequestStream().Write(buf, 0, buf.Length);
using (var response = (HttpWebResponse)request.GetResponse())
{
}
am I missing something in the configuration
Upvotes: 0
Views: 57
Reputation: 1832
Assuming https://xxxxxxx
is valid in the browser and the SSL certificate is valid, you may need to pass correct headers like User-Agent
if you haven't already.
Upvotes: 2