WebClient.GetWebResponse Method
Definition
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.
Overloads
GetWebResponse(WebRequest) |
Returns the WebResponse for the specified WebRequest. |
GetWebResponse(WebRequest, IAsyncResult) |
Returns the WebResponse for the specified WebRequest using the specified IAsyncResult. |
GetWebResponse(WebRequest)
- Source:
- WebClient.cs
- Source:
- WebClient.cs
- Source:
- WebClient.cs
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
Parameters
- request
- WebRequest
A WebRequest that is used to obtain the response.
Returns
A WebResponse containing the response for the specified WebRequest.
Examples
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;
}
Remarks
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.
Applies to
GetWebResponse(WebRequest, IAsyncResult)
- Source:
- WebClient.cs
- Source:
- WebClient.cs
- Source:
- WebClient.cs
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
Parameters
- request
- WebRequest
A WebRequest that is used to obtain the response.
- result
- IAsyncResult
An IAsyncResult object obtained from a previous call to BeginGetResponse(AsyncCallback, Object) .
Returns
A WebResponse containing the response for the specified WebRequest.
Examples
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;
}
Remarks
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.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기