How to fix "HTTP Error 400. The size of the request headers is ... | http error 400. the size of the request headers is
ForMeISpentdayslookingintotheissue.Readingblobsandsolutions,clearedcache,setmaxlimitofheadersizetoabiggernumber,nothingworked.Eventuallyitwouldfail.Thisissuedidnotoccurifiredploymyapplicationbutoveraperiodoftimethiswouldstartcomingup,whichmademerealizeitmightbeaddinginmemory.IwascallinganotherAPIfrommyprojectwherewecreatedtherequestandsentitandgotthedata.publicasyncTask
For Me I Spent days looking into the issue. Reading blobs and solutions, cleared cache, set max limit of header size to a bigger number, nothing worked. Eventually it would fail.
This issue did not occur if i redploy my application but over a period of time this would start coming up,which made me realize it might be adding in memory.
I was calling another API from my project where we created the request and sent it and got the data.
public async Task<DataList> GeDataList() { Client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", await _tokenProvider.GetBearerToken()); Client.DefaultRequestHeaders.Add("X-CorrelationId", Guid.NewGuid().ToString()); var requestMessage = new HttpRequestMessage() { Method = HttpMethod.Post, RequestUri = new Uri($"{Config.apiurl}{string.Format(Config.id, id2 == null ? id1 : id2)}") }; re...