Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //..
- //..
- // Set selected User Agent
- httpClient.DefaultRequestHeaders.Add("User-Agent", randomUserAgent);
- // 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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement