I have a legacy .NET 4.8 framework project.
I have tried to get these headers:
Accept-Encoding
CacheControl
sent to my endpoint.
But looking with Fiddler, they are not sent, even if I explicitly set them. Any idea why?
HttpRequestMessage TmpRequest = new HttpRequestMessage(HttpMethod.Get, url);
TmpRequest.Headers.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0");
TmpRequest.Headers.AcceptEncoding.ParseAdd("gzip");
TmpRequest.Headers.AcceptEncoding.ParseAdd("deflate");
TmpRequest.Headers.AcceptEncoding.ParseAdd("br");
TmpRequest.Headers.CacheControl = new CacheControlHeaderValue
{
NoCache = true
};
HttpResponseMessage TmpResponse = await TmpClient.SendAsync(TmpRequest);
Only the UserAgent is sent as header...
But why not Accept-Encoding and CacheControl ?
Here is what fiddler shows :
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
url=localhost:8888). The only line that could be different would beHttpClient TmpClient = new HttpClient();Does Fiddler startup as the system proxy? IsOptions->Connections->Act as system proxy on startupchecked?