I m trying to invoke a URL in C#, I am just interested in invoking, and dont care about response. When i have the following, does it mean that I m invoking the URL?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
I m trying to invoke a URL in C#, I am just interested in invoking, and dont care about response. When i have the following, does it mean that I m invoking the URL?
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
Probably not. See: http://www.codeproject.com/KB/webservices/HttpWebRequest_Response.aspx
You're allowed to set the Method, ContentType, etc., all which would have to be done before the request is actually sent. It looks like GetResponse() actually sends the request. You can simply ignore the return value.
First) Create WebRequest to execute URL.
Second) Use WebResponse to get response.
Finally) Use StreamReader to decode response and convert it to normal string.
No when you say request.GetResponse(); then you invoke it.
You need to actually perform the request:
The call to GetResponse makes the outbound call to the server. You can discard the response if you don't care about it.
You can use this: