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

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -