ASP.NET MVC - Using cURL or similar to perform requests in application

前端 未结 4 1941
一整个雨季
一整个雨季 2021-02-01 11:06

I\'m building an application in ASP.NET MVC (using C#) and I would like to know how I can perform calls like curl http://www.mywebsite.com/clients_list.xml inside my controller

4条回答
  •  情歌与酒
    2021-02-01 11:45

    Look into the System.Net.WebClient class. It should offer the functionality you require. For finer grained control, you might find WebRequest to be more useful, but WebClient seems the best fit for your needs.

提交回复
热议问题