Reputation: 14039
I wish to send a HTTP request to a remote web service using the specified proxy. Is this achievable? if so how?
Thank you.
Upvotes: 1
Views: 790
Reputation: 100348
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();
Upvotes: 4