System.Net.HttpClientComponent.TNetHTTPClient.Patch
Delphi
function Patch(const AURL: string; const ASource: TStream = nil; const AResponseContent: TStream = nil;
const AHeaders: TNetHeaders = nil): IHTTPResponse; overload;
C++
System::Net::Httpclient::_di_IHTTPResponse __fastcall Patch(const System::UnicodeString AURL, System::Classes::TStream* const ASource = (System::Classes::TStream*)(0x0), 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.HTTPClientComponent.pas System.Net.HTTPClientComponent.hpp |
System.Net.HttpClientComponent | TNetHTTPClient |
Description
Sends an HTTP request to the specified URL with the specified data (ASource
) using the PATCH
HTTP request method, waits for the server to send a response, and returns the HTTP response of the server.
If you want to receive the response data as your HTTP client downloads it from the target server, instead of waiting for your HTTP client to download the whole data, use the AResponseContent
parameter to specify a stream to receive the downloaded data. Alternatively, 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 response object that Get returns.
Regardless of whether you receive the data as it comes or wait for the whole data to be available, you can handle the OnReceiveData event to track the progress of the download of the response data.
Use AHeaders
to include custom HTTP request headers in your HTTP request.
If your HTTP request must go through a proxy HTTP server that may not support the PATCH
HTTP request method, use PatchAlternative instead to disguise your PATCH
request method as a PUT
request method.
Patch raises an ENetHTTPRequestException if the HTTP request reaches the maximum number of redirects.
See Also
- System.Net.HttpClientComponent.TNetHTTPClient.Delete
- System.Net.HttpClientComponent.TNetHTTPClient.Get
- System.Net.HttpClientComponent.TNetHTTPClient.Head
- System.Net.HttpClientComponent.TNetHTTPClient.Merge
- System.Net.HttpClientComponent.TNetHTTPClient.Options
- System.Net.HttpClientComponent.TNetHTTPClient.Post
- System.Net.HttpClientComponent.TNetHTTPClient.Put
- System.Net.HttpClientComponent.TNetHTTPClient.Trace