c# - The remote server returned an error (400) -


i got bad request using 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 missing in configuration

assuming https://xxxxxxx valid in browser , ssl certificate valid, may need pass correct headers user-agent if haven't already.


Comments

Popular posts from this blog

c++ - list<myClass<int> * > sort -

c - Defining floating point constants, how many digits are useful? -

C# Apple Bonjour - how to monitor service records within Windows -