Версия HTTP запроса
Почему в запросе всё таки Version: 1.1, если использую httpClient.DefaultRequestVersion = new Version(2, 0);
var httpClientHandler = new HttpClientHandler()
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate | DecompressionMethods.Brotli,
AllowAutoRedirect = true
};
HttpClient httpClient = new HttpClient(httpClientHandler);
httpClient.DefaultRequestVersion = new Version(2, 0);
В запросе:
HttpRequestMessage request = new HttpRequestMessage(System.Net.Http.HttpMethod.Post, "https://***.php");
Вот такие данные:
{StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
Server: nginx/1.18.0
Date: Sun, 25 Apr 2021 11:14:44 GMT
Connection: keep-alive
X-Powered-By: PHP/7.4.8
Access-Control-Allow-Origin: https://***.ru
Access-Control-Allow-Credentials: true
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
}}