From RAD Studio API Documentation
Jump to: navigation, search


function PatchAlternative(const AURL: string; const ASource: TStream = nil; const AResponseContent: TStream = nil; const AHeaders: TNetHeaders = nil): IHTTPResponse;


_di_IHTTPResponse __fastcall PatchAlternative(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>());


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


Sends an HTTP request to the specified URL with the specified data (ASource) using the PATCH HTTP request method masked as a PUT request method, waits for the server to send a response, and returns the HTTP response of the server.

Specifically, the HTTP request that PatchAlternative sends uses PUT as HTTP request method and includes the following HTTP request header to indicate that your request is actually a patch request:

  • X-Method-Override: PATCH

Use PatchAlternative if your HTTP request must go through a proxy HTTP server that may not support the PATCH HTTP request method, otherwise you can use Patch instead.

Use AHeaders to include custom HTTP request headers in your HTTP request.

PatchAlternative raises an ENetHTTPRequestException if the HTTP request reaches the maximum number of redirects.

See Also