Mono Class Library: System.Net.WebRequest Overview | Members

System.Net.WebRequest.GetResponse Method

Returns a response to a request. [Edit]

public virtual WebResponse GetResponse ()

Returns

A System.Net.WebResponse containing the response to the request. [Edit]

Exceptions

TypeReason
NotSupportedExceptionThis method is not overridden in the derived class. [Edit]
System.Net.WebException

The request timed out.

-or-

An error occurred while processing the request.

[Edit]

Remarks

Operation

This method returns an instance of a type derived from System.Net.WebResponse that is registered for the WebRequest.RequestUri property of the current instance. This new instance is required to contain a response from the resource to the current request.

If the timeout period for the request expires, or an error occurs while processing the request, this method is required to throw a System.Net.WebException exception.

The System.Net.WebRequest class is abstract and does not provide an implementation for this method. This method throws NotSupportedException.

Note to Inheritors
This method must be overridden by classes that inherit from System.Net.WebRequest to provide this functionality.

Usage
Use this method for synchronous access to a resource. For asynchronous access, use the WebRequest.BeginGetResponse(AsyncCallback, object) and WebRequest.EndGetResponse(IAsyncResult) methods.

[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0