Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net.Http;
- class Program
- {
- static async Task Main()
- {
- // Create an instance of HttpClient
- HttpClient httpClient = new HttpClient();
- // Make a GET request to httpbin.io/user-agent
- HttpResponseMessage response = await httpClient.GetAsync("https://httpbin.io/user-agent");
- // Read and print the content
- string content = await response.Content.ReadAsStringAsync();
- Console.WriteLine(content);
- }
- }
Add Comment
Please, Sign In to add comment