I have a .net core 3.1 azure function apps that calls Azure API. I am passing a custom header "Request-Id", my custom header is a Guid converted to string. I don't know but for some reason, when my request reaches to the API Server the "Request-Id" header value changed. For example, I passed E2AD0ABE-9D8F-4D7E-BFAB-AA8A756DF9D2 in the "Request-Id" header but when it reached the API it become 3794FBB7-1564-4BD9-86B9-F136AF9D61DF|.898989834
I tried it in .net core2.0 client and it's working ok. I don't know if this is a bug in .net core 3.1 or I just need to do it(passing custom header) on a different way.
var requestId = Guid.NewGuid().ToString();
using (var client = new HttpClient())
{
var uri = "https://testurl/v1/Pr/";
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
Content = sc,
RequestUri = new Uri(uri)
};
client.DefaultRequestHeaders.Add("Request-Id", requestId);
var result = client.SendAsync(request).Result;
if (result.IsSuccessStatusCode)
{
response = result.StatusCode.ToString();
}
}