[RESOLVED] Make a Get Web Request
I need to make a single GET request using httpWebRequest class.
I was wondering do i need to get response necessary or making only request is enough?
Code:
Dim req As HttpWebRequest = CType(WebRequest.Create("http://www.service.com/receiver.aspx?param=value¶m2=value"), HttpWebRequest)
or i have to get the response anyway?
Btw, what is the default value of the HttpWebRequest Method? Is it Get or just nothing?
EDIT: Response is necessary ! Thanks
Re: [RESOLVED] Make a Get Web Request
Re: [RESOLVED] Make a Get Web Request
It is pretty self-explanatory :D
Code:
// Create an HttpWebRequest using WebRequest.Create (see .NET docs)!
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
// Execute the request and obtain the response stream
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream responseStream = response.GetResponseStream();
Means just saying webrequest.Create(uri) it does nothing
Thanks for the reply it is much appreciated!