Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用https://www.baidu.com无法获取,用http://www.baidu.com可以获取 #34

Open
wpyok168 opened this issue Apr 27, 2024 · 0 comments

Comments

@wpyok168
Copy link

wpyok168 commented Apr 27, 2024

HttpClient client = new HttpClient();
client.Setup(new TouchSocketConfig().SetRemoteIPHost(new IPHost("https://www.baidu.com")));
client.Connect();//先做连接
HttpRequest request = new HttpRequest();
request
    .InitHeaders()
    .SetUrl("/")
    .SetHost(client.RemoteIPHost.Host)
    .AsGet();
var respose = client.Request(request, millisecondsTimeout: 1000 * 10);
Console.WriteLine(respose.GetBody());
Console.ReadLine();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant