How do I make my http request proxy in c#? -
when use code below error: servicepointmanager not support proxies https scheme.
how change code around make proxyed?
var request = (httpwebrequest) webrequest.create("https://website.com/index.php?"); var myproxy = new webproxy("https:/website.com/index.php?"); request.proxy = myproxy; string postdata = "secret=" +textbox1.text; byte[] data = encoding.ascii.getbytes(postdata); request.method = "post"; request.contenttype = "application/x-www-form-urlencoded"; request.contentlength = data.length; using (stream stream = request.getrequeststream()) { stream.write(data, 0, data.length); } var response = (httpwebresponse) request.getresponse(); string read = new streamreader(response.getresponsestream()).readtoend(); response.close();
Comments
Post a Comment