I wish to send a HTTP request to a remote web service using the specified proxy. Is this achievable? if so how?
Thank you.
var proxy = new WebProxy("proxy.example.com", 8080)
{
Credentials = new NetworkCredential("login", "password") // optional
};
var request = new WebRequest
{
Proxy = proxy // optional. if null - request goes without proxy, obviously
};
var response = request.GetResponse();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.