I am new to C#, I need to send HTTP GET request and read answer. I am familiar with Java and easy can do it URLConnection class but I don't know in c#. Can anybody help ?
Asked
Active
Viewed 8,509 times
1 Answers
18
The simplest way is to use WebClient
:
WebClient client = new WebClient();
string text = client.DownloadString(url);
(That's the synchronous form; it also supports asynchronous requests.)
For more control you might want to use HttpWebRequest
.

Jon Skeet
- 1,421,763
- 867
- 9,128
- 9,194