GetResponse Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Returns a response from an Internet resource.

Namespace:  System.Net
Assembly:  System.Http (in System.Http.dll)

public override WebResponse GetResponse()

Return Value

Type: System.Net..::..WebResponse
A WebResponse that contains the response from the Internet resource.

The GetResponse method returns a WebResponse object that contains the response from the Internet resource. The actual instance returned is an HttpWebResponse, and can be typecast to that class to access HTTP-specific properties.

Caution noteCaution

You must call the Close method to close the stream and release the connection. Failure to do so may cause your application to run out of connections.

When using the POST method, you must get the request stream, write the data to be posted, and close the stream. This method blocks waiting for content to post; if there is no time-out set and you do not provide content, the calling thread blocks indefinitely.

Show: