I am relatively new to C# especially in the web aspects of it.
Let's say I have the following:
string URI = "http://www.domain.com/post.php";
string params = "param1=value1¶m2=value2¶m3=value3";
I understand I can post data like this:
using (WebClient wc = new WebClient())
{
wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
string HtmlResult = wc.UploadString(URI, params);
}
But how do I use a proxy when posting this data?
I found this Related Link:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URI);
WebProxy myproxy = new WebProxy("1.1.1.1", 80);
myproxy.BypassProxyOnLocal = false;
request.Proxy = myproxy;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse) request.GetResponse();