79298151

Date: 2024-12-20 18:57:07
Score: 1
Natty:
Report link

I don't why, but I needed to change @Craig SendAsync method from InterceptingHttpMessageHandler to:

protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
    var _request = new HttpRequestMessage(HttpMethod.Post, request.RequestUri)
    {
        Content = request.Content!
    };

    foreach (var header in request.Headers)
    {
        _request.Headers.TryAddWithoutValidation(header.Key, header.Value);
    }

    return await _client.SendAsync(_request, cancellationToken);
}

I was getting the following error:

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher...

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Craigmethod
  • Low reputation (0.5):
Posted by: hmiguel