calling an http url from a .net console application?

后端 未结 3 1363
醉梦人生
醉梦人生 2020-12-21 04:55

Is it possible to call an http url from a .net console application? can anyone give an idea.?

3条回答
  •  余生分开走
    2020-12-21 05:57

    Here is a nice example if you are trying to fetch HTML from a web page using HTTP.

    UPDATE: As you have posted in comment that only thing you expect in response is a string would be good to use WebClient as Chris Fulstow says in his answer.

    System.Net.WebClient().DownloadString(url)
    

提交回复
热议问题