79169449

Date: 2024-11-08 09:30:07
Score: 1.5
Natty:
Report link

I finally found a solution/workaround for my problem.

I forced the http protocol version to be 1.1

httpRequest.Version = HttpVersion.Version11;

I had tried to set the azure web site to accept http 2.0 but this kept giving me :

The HTTP/2 server sent invalid data on the connection. HTTP/2 error code 'PROTOCOL_ERROR' (0x1). (HttpProtocolError) ---> System.Net.Http.HttpProtocolException: The HTTP/2 server sent invalid data on the connection. HTTP/2 error code 'PROTOCOL_ERROR' (0x1). (HttpProtocolError) at System.Net.Http.Http2Connection.ThrowRequestAborted.

It seems that HttpClient defaults to 2.0 and that is causing issues when calling azure web app internally. I don't know why.

Any further explations would be wellcomed.

Thank you

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • No code block (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Kostas Xagoraris