This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Community Hub.
Azure App Service supports HTTP 2.0. The major advance of HTTP/1.1 was the use of persistent connections to service multiple requests in a row. In HTTP/2, a persistent connection can be used to service multiple simultaneous requests.
This blog will demonstrate how you can send HTTP 2.0 Request to app service for testing using C#:
Step 1:
Go to > App Service > Configuration > Enable HTTP 2.0
Step 2:
Create a .Net Core Console Application / Web Application as per requirement . In this example I have taken a .Net Core Console Application:
The HTTPClient class has DefaultRequestVersion property with which you can set the default version of the requests as below:
You should be able to see a successful HTTP Response once the code executes:
For more information you can refer the below documents:
- HttpClient Class (System.Net.Http) | Microsoft Learn
- HttpClient.DefaultRequestVersion Property (System.Net.Http) | Microsoft Learn