C# – How to make a HTTP call

You’ve got some extra stuff in there if you’re really just trying to call a website. All you should need is:

WebRequest webRequest = WebRequest.Create("http://ussbazesspre004:9002/DREADD?" + fileName);
WebResponse webResp = webRequest.GetResponse();

If you don’t want to wait for a response, you may look at BeginGetResponse to make it asynchronous .

Leave a Comment