发送请求
使用您列表中的静态ISP代理向 https://ipinfo.thordata.com发起请求。请将 USERNAME 和 PASSWORD 替换为您的代理用户凭据。
Make a request to https://ipinfo.thordata.com using static ISP proxies from your list. Replace USERNAME and PASSWORD with your proxy user credentials.
curl -x IP:6666 -U "USERNAME:PASSWORD" "https://ipinfo.thordata.com"请注意,必须严格遵循上述示例中的用户名字符串构建格式才能成功发起请求。务必保持语法结构完全一致,并注意用户名和密码区分大小写。
代码示例
curl -x ip:6666 -U "USERNAME:PASSWORD" "https://ipinfo.thordata.com"using System;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
class csharp_https
{
static void Main(string[] args)
{
Task t = new Task(DownloadPageAsync);
t.Start();
Console.ReadLine();
}
static async void DownloadPageAsync()
{
string page = "https://ipinfo.thordata.com";
var proxy = new WebProxy("https://ip:6666")
{
UseDefaultCredentials = false,
Credentials = new NetworkCredential(
userName: "USERNAME",
password: "PASSWORD")
};
var httpClientHandler = new HttpClientHandler()
{
Proxy = proxy,
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
};
var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);
var response = await client.GetAsync(page);
using (HttpContent content = response.Content)
{
string result = await content.ReadAsStringAsync();
Console.WriteLine(result);
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
}Last updated
Was this helpful?