<t>There are several ways to perform HTTP GET and POST requests:<br/>
<br/>
Method A: HttpClient (Preferred)<br/>
<br/>
Available in: .NET Framework 4.5+, .NET Standard 1.1+, and .NET Core 1.0+.<br/>
<br/>
It is currently the preferred approach, and is asynchronous and high performance. Use the built-in version in most cases, but for very old platforms there is a NuGet package.<br/>
<br/>
using System.Net.Http;<br/>
<br/>
```<br/>
<br/>
Setup<br/>
<br/>
[It is recommended](https://learn.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/) to instantiate one `HttpClient` for your application's lifetime and share it unless you have a specific reason not to.<br/>
<br/>
```<br/>
private static readonly HttpClient client = new HttpClient();<br/>
<br/>
```<br/>
<br/>
See [`HttpClientFactory`](https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests#what-is-httpclientfactory) for a [dependency injection](https://en.wikipedia.org/wiki/Dependency_injection) solution.<br/>
<br/>
- <br/>
POST<br/>
<br/>
```<br/>
var values = new Dictionary<br/>
{<br/>
{ "thing1", "hello" },<br/>
{ "thing2", "world" }<br/>
};<br/>
<br/>
var content = new FormUrlEncodedContent(values);<br/>
<br/>
var response = await client.PostAsync("http://www.example.com/recepticle.aspx", content);<br/>
<br/>
var responseString = await response.Content.ReadAsStringAsync();<br/>
<br/>
```<br/>
<br/>
- <br/>
GET<br/>
<br/>
```<br/>
var responseString = await client.GetStringAsync("http://www.example.com/recepticle.aspx");<br/>
<br/>
```<br/>
<br/>
Method B: Third-Party Libraries<br/>
<br/>
***[RestSharp](https://github.com/restsharp/RestSharp)***<br/>
<br/>
- <br/>
POST<br/>
<br/>
```<br/>
var client = new RestClient("http://example.com");<br/>
// client.Authenticator = new HttpBasicAuthenticator(username, password);<br/>
var request = new RestRequest("resource/{id}");<br/>
request.AddParameter("thing1", "Hello");<br/>
request.A<br/>
<br/>
*(Réponse tronquée)*</t>