System.Net.HttpClient.THTTPClient.GetRequest

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetRequest(const ARequestMethod: string; const AURI: TURI): IHTTPRequest; overload;
function GetRequest(const ARequestMethod, AURL: string): IHTTPRequest; overload;

C++

HIDESBASE _di_IHTTPRequest __fastcall GetRequest(const System::UnicodeString ARequestMethod, const System::Net::Urlclient::TURI &AURI)/* overload */;
HIDESBASE _di_IHTTPRequest __fastcall GetRequest(const System::UnicodeString ARequestMethod, const System::UnicodeString AURL)/* overload */;

Properties

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

Description

Gets the request instance associated with the HTTP client for the given ARequestMethod and a URI or a URL.

The GetRequest method is overloaded:

  • Call the first overloaded GetRequest method with the ARequestMethod and the URI to use for the request.
  • Call the second overloaded GetRequest method with the ARequestMethod and a given AURL to use for the request. This method calls the first overloaded GetRequest method creating the URI for the given AURL.

GetRequest returns an interface to the HTTP request.

Exceptions

GetRequest raises an ENetHTTPRequestException if the URL host cannot be reached. In the Execute method:

  • Under Windows platforms, this is tested before doing the connection to the host.
  • Under other platforms, this exception is raised upon connection.

See Also