THttpClient Class
A high-level HTTP client used to create, send, and receive HTTP requests and responses.
Remarks
THttpClient wraps an THttpEngine and adds convenience methods such as Get, together with the OnSendingRequest and OnResponseReceived events. Requests whose URI uses the local scheme are dispatched to an in-process engine instead of the network engine.
Syntax
Unit: Sparkle.Http.Client
THttpClient = class(TObject);
Constructors
| Name | Description |
|---|---|
| Create | Creates the client along with its default and in-process engines. |
Methods
| Name | Description |
|---|---|
| CreateRequest | Creates a new, empty request associated with this client's engine. |
| Get | Sends a GET request to the specified URI and returns the response. |
| Send | Sends the specified request and returns the response. |
Properties
| Name | Description |
|---|---|
| Engine | Gets the underlying HTTP engine used to send network requests. |
| OnResponseReceived | Gets or sets the callback invoked immediately after each response is received. |
| OnSendingRequest | Gets or sets the callback invoked immediately before each request is sent. |