1

Is it possible to send a get/post..etc request using http 2 with flurl? If not, is there a way to do it?

I have tried using Use HTTP 2 with HttpClient in .Net, but I always get WinHttpException: Error 12156 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, 'The HTTP redirect request failed'.

null
  • 171
  • 1
  • 9

1 Answers1

1

You should disable auto redirects to get it to work. The problem is most likely with the server doing something non-standard/wrong.

Just set the AllowAutoRedirect property to false for the HttpClientHandler of your HttpClient.

new HttpClient(new HttpClientHandler { AllowAutoRedirect = false });

However, you should still see what the redirect response really is and probably handle it manually by making another request. It's hard to say without knowing the URL and what it really tries to return to you.

Timo Salomäki
  • 7,099
  • 3
  • 25
  • 40
  • The reason it was giving that error was because it was constantly being redirected to the same page, which would redirect it to the same page again, etc – null Feb 09 '20 at 00:29