Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the WebResponse for the specified WebRequest.
GetWebResponse(WebRequest) |
Returns the WebResponse for the specified WebRequest. |
GetWebResponse(WebRequest, IAsyncResult) |
Returns the WebResponse for the specified WebRequest using the specified IAsyncResult. |
Returns the WebResponse for the specified WebRequest.
protected:
virtual System::Net::WebResponse ^ GetWebResponse(System::Net::WebRequest ^ request);
protected virtual System.Net.WebResponse GetWebResponse(System.Net.WebRequest request);
abstract member GetWebResponse : System.Net.WebRequest -> System.Net.WebResponse
override this.GetWebResponse : System.Net.WebRequest -> System.Net.WebResponse
Protected Overridable Function GetWebResponse (request As WebRequest) As WebResponse
A WebRequest that is used to obtain the response.
A WebResponse containing the response for the specified WebRequest.
The following code example shows an implementation of this method that can be customized by a class derived from WebClient.
virtual WebResponse^ GetWebResponse( WebRequest^ request ) override
{
WebResponse^ response = WebClient::GetWebResponse( request );
// Perform any custom actions with the response ...
return response;
}
protected override WebResponse GetWebResponse (WebRequest request)
{
WebResponse response = base.GetWebResponse (request);
// Perform any custom actions with the response ...
return response;
}
Caution
WebRequest
, HttpWebRequest
, ServicePoint
, and WebClient
are obsolete, and you shouldn't use them for new development. Use HttpClient instead.
The object returned by this method is obtained by calling the GetResponse method on the specified WebRequest object.
This method can be called only by classes that inherit from WebClient. It is provided to give inheritors access to the underlying WebResponse object.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Returns the WebResponse for the specified WebRequest using the specified IAsyncResult.
protected:
virtual System::Net::WebResponse ^ GetWebResponse(System::Net::WebRequest ^ request, IAsyncResult ^ result);
protected virtual System.Net.WebResponse GetWebResponse(System.Net.WebRequest request, IAsyncResult result);
abstract member GetWebResponse : System.Net.WebRequest * IAsyncResult -> System.Net.WebResponse
override this.GetWebResponse : System.Net.WebRequest * IAsyncResult -> System.Net.WebResponse
Protected Overridable Function GetWebResponse (request As WebRequest, result As IAsyncResult) As WebResponse
A WebRequest that is used to obtain the response.
An IAsyncResult object obtained from a previous call to BeginGetResponse(AsyncCallback, Object) .
A WebResponse containing the response for the specified WebRequest.
The following code example shows an implementation of this method that can be customized by a class derived from WebClient.
virtual WebResponse^ GetWebResponse( WebRequest^ request, IAsyncResult^ result ) override
{
WebResponse^ response = WebClient::GetWebResponse( request, result );
// Perform any custom actions with the response ...
return response;
}
protected override WebResponse GetWebResponse (WebRequest request, IAsyncResult result)
{
WebResponse response = base.GetWebResponse (request, result);
// Perform any custom actions with the response ...
return response;
}
Caution
WebRequest
, HttpWebRequest
, ServicePoint
, and WebClient
are obsolete, and you shouldn't use them for new development. Use HttpClient instead.
The object returned by this method is obtained by calling the EndGetResponse method on the specified WebRequest object.
This method can be called only by classes that inherit from WebClient. It is provided to give inheritors access to the underlying WebResponse object.
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in