3.55Enabling Standard Request Headers
Created on Aug 17, 2026~2 min read
To improve the compatibility of network requests sent by the application through the HTTP client and avoid being blocked by WAF (Web Application Firewall), the framework provides a one-click configuration method for quickly and uniformly setting standard request headers:
HttpRequestBuilder.Get("https://furion.net") .UseStandardRequestHeaders();HttpRequestBuilder.Get("https://furion.net") .UseStandardRequestHeaders(false); // Disable standard request headersIn addition to enabling standard header configuration for a single request, you can also register it globally to enable it in HttpClient:
// Enable for the default clientservices.AddHttpClient(string.Empty, client =>{ client.UseStandardRequestHeaders();});services.AddHttpRemote();After enabling standard request headers, the request will automatically add the following headers:
Accept:application/json,text/plain;q=0.9,*/*;q=0.8(explicit media type priority to avoid being blocked byWAF)Connection: enables persistent connections (Keep-Alive), reducing the overhead of establishing and closingTCPconnections