System.Net.HttpClient.THTTPClient.EndAsyncHTTP
Delphi
class function EndAsyncHTTP(const AAsyncResult: IAsyncResult): IHTTPResponse; overload;
class function EndAsyncHTTP(const AAsyncResult: IHTTPResponse): IHTTPResponse; overload;
C++
__classmethod _di_IHTTPResponse __fastcall EndAsyncHTTP(const System::Types::_di_IAsyncResult AAsyncResult)/* overload */;
__classmethod _di_IHTTPResponse __fastcall EndAsyncHTTP(const _di_IHTTPResponse AAsyncResult)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Net.HttpClient.pas System.Net.HTTPClient.hpp |
System.Net.HttpClient | THTTPClient |
Description
Ensures that the specified response succeeded, or raises an exception if the response failed.
You usually call EndAsyncHTTP inside the callback function or event handler of your asynchronous request, where you know that the response data has been received already. However, you can actually call EndAsyncHTTP at any moment, which stops the program execution until the response data is received, effectively turning the asynchronous request into a synchronous request.
EndAsyncHTTP raises an ENetHTTPRequestException if the HTTP request reaches the maximum number of redirects.