System.Net.HttpClient.THTTPClient.BeginGetRange

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function BeginGetRange(const AURL: string; AStart: Int64; AnEnd: Int64 = -1; const AResponseContent: TStream = nil;  const AHeaders: TNetHeaders = nil): IAsyncResult; overload;
function BeginGetRange(const AsyncCallback: TAsyncCallback; const AURL: string; AStart: Int64; AnEnd: Int64 = -1;  const AResponseContent: TStream = nil; const AHeaders: TNetHeaders = nil): IAsyncResult; overload;
function BeginGetRange(const AsyncCallbackEvent: TAsyncCallbackEvent; const AURL: string; AStart: Int64; AnEnd: Int64 = -1;  const AResponseContent: TStream = nil; const AHeaders: TNetHeaders = nil): IAsyncResult; overload;

C++

System::Types::_di_IAsyncResult __fastcall BeginGetRange(const System::UnicodeString AURL, __int64 AStart, __int64 AnEnd = -1LL, System::Classes::TStream* const AResponseContent = (System::Classes::TStream*)(0x0), const System::DynamicArray<System::Net::Urlclient::TNameValuePair> AHeaders = System::DynamicArray<System::Net::Urlclient::TNameValuePair>())/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginGetRange(const System::Classes::_di_TAsyncCallback AsyncCallback, const System::UnicodeString AURL, __int64 AStart, __int64 AnEnd = -1LL, System::Classes::TStream* const AResponseContent = (System::Classes::TStream*)(0x0), const System::DynamicArray<System::Net::Urlclient::TNameValuePair> AHeaders = System::DynamicArray<System::Net::Urlclient::TNameValuePair>())/* overload */;
System::Types::_di_IAsyncResult __fastcall BeginGetRange(const System::Classes::TAsyncProcedureEvent AsyncCallbackEvent, const System::UnicodeString AURL, __int64 AStart, __int64 AnEnd = -1LL, System::Classes::TStream* const AResponseContent = (System::Classes::TStream*)(0x0), const System::DynamicArray<System::Net::Urlclient::TNameValuePair> AHeaders = System::DynamicArray<System::Net::Urlclient::TNameValuePair>())/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Net.HttpClient.pas
System.Net.HTTPClient.hpp
System.Net.HttpClient THTTPClient

Description

Starts an asynchronous HTTP request using the GET HTTP request method with the Range header.

The Range header indicates a specific fragment of the source data that you want to receive.

When you call BeginGetRange, you must provide the data required to perform your HTTP request:

  • AURL is the target URL of your request.
  • AStart is the starting byte of the range of source data that you request.
  • AEnd is the ending byte of the range of source data that you request. Use -1 (default) to request the data since AStart until the end.
  • AResponseContent (optional) is a stream where you want to receive the response data as your HTTP client downloads the response data from the target server.

    If you do not specify a stream for AResponseContent, you can wait for your HTTP client to download the whole response data, and obtain the response data as a stream from the ContentStream property of the asynchronous result object that BeginGetRange returns.
  • AHeaders (optional) is a list of headers to include in the request.
  • AsyncCallback (optional) is a callback procedure to be called when a response is received or the request fails.
  • AsyncCallbackEvent (optional) is an event handler to be called when a response is received or the request fails.

For more information, see BeginExecute.

See Also