TCnHttpClient Class

Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI.

Namespace: CNClrLib.Component.HttpClient
TComponent
  CNClrLib.Control.Base.TClrBaseComponent
    CNClrLib.Component.HttpClient.TCnHttpClient
type
 TCnHttpClient = class(TClrBaseComponent)
 end;

The TCnHttpClient type exposes the following members.

Show:
 NameDescription
Create(TComponent)

Creates and initializes a TCnHttpClient instance. (Overrides TClrBaseComponent.Create(TComponent).)

Destroy

Frees the resources allocated with a TCnHttpClient instance. (Overrides TClrBaseComponent.Destroy.)

Top
Show:
 NameDescription
BaseAddress

Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.

DefaultClrObject

Get the common language runtime object interface for this component. (Inherited from TClrBaseComponent.)

DefaultRequestHeaders

Gets the headers which should be sent with each request.

MaxResponseContentBufferSize

Gets or sets the maximum number of bytes to buffer when reading the response content.

Timeout

Gets or sets the timespan to wait before the request times out.

Top
Show:
 NameDescription
CancelPendingRequests

Cancel all pending requests on this instance.

DeleteAsync(String)

Overloaded. Send a DELETE request to the specified Uri as an asynchronous operation.

DeleteAsync(String,_CancellationToken)

Overloaded. Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

DeleteAsync(_Uri)

Overloaded. Send a DELETE request to the specified Uri as an asynchronous operation.

DeleteAsync(_Uri,_CancellationToken)

Overloaded. Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation.

Dispose

Releases the unmanaged resources used by the HttpClient and optionally disposes of the managed resources.

DoGetDefaultClrObject

Represents method DoGetDefaultClrObject. (Overrides TClrBaseComponent.DoGetDefaultClrObject.)

DoGetDotNetBaseComponent

Represents method DoGetDotNetBaseComponent. (Overrides TClrBaseComponent.DoGetDotNetBaseComponent.)

GetAsync(String)

Overloaded. Send a GET request to the specified Uri as an asynchronous operation.

GetAsync(String,THttpCompletionOption)

Overloaded. Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation.

GetAsync(String,THttpCompletionOption,_CancellationToken)

Overloaded. Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation.

GetAsync(String,_CancellationToken)

Overloaded. Send a GET request to the specified Uri with a cancellation token as an asynchronous operation.

GetAsync(_Uri)

Overloaded. Send a GET request to the specified Uri as an asynchronous operation.

GetAsync(_Uri,THttpCompletionOption)

Overloaded. Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation.

GetAsync(_Uri,THttpCompletionOption,_CancellationToken)

Overloaded. Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation.

GetAsync(_Uri,_CancellationToken)

Overloaded. Send a GET request to the specified Uri with a cancellation token as an asynchronous operation.

GetByteArrayAsync(String)

Overloaded. Send a GET request to the specified Uri with a cancellation token as an asynchronous operation.

GetByteArrayAsync(_Uri)

Overloaded. Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation.

GetClrObject

Represents method GetClrObject. (Inherited from TClrBaseComponent.)

GetStreamAsync(String)

Overloaded. Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

GetStreamAsync(_Uri)

Overloaded. Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation.

GetStringAsync(String)

Overloaded. Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation.

GetStringAsync(_Uri)

Overloaded. Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation.

PostAsync(String,_HttpContent)

Overloaded. Send a POST request to the specified Uri as an asynchronous operation.

PostAsync(String,_HttpContent,_CancellationToken)

Overloaded. Send a POST request with a cancellation token as an asynchronous operation.

PostAsync(_Uri,_HttpContent)

Overloaded. Send a POST request to the specified Uri as an asynchronous operation.

PostAsync(_Uri,_HttpContent,_CancellationToken)

Overloaded. Send a POST request with a cancellation token as an asynchronous operation.

PutAsync(String,_HttpContent)

Overloaded. Send a PUT request to the specified Uri as an asynchronous operation.

PutAsync(String,_HttpContent,_CancellationToken)

Overloaded. Send a PUT request with a cancellation token as an asynchronous operation.

PutAsync(_Uri,_HttpContent)

Overloaded. Send a PUT request to the specified Uri as an asynchronous operation.

PutAsync(_Uri,_HttpContent,_CancellationToken)

Overloaded. Send a PUT request with a cancellation token as an asynchronous operation.

RegisterEventCallBack(ClrWString,Pointer)

Add an event to the instance using the specified event name and function pointer which is the event handler. The RegisterEventCallBack method does not directly add the event handler to the event. A hooking mechanism is used such that if the event is fired, the hook event is also fired which in turn calls the function pointer. (Inherited from TClrBaseComponent.)

RegisterEventSource

Register the Delphi object which will raise the .Net event handler. (Inherited from TClrBaseComponent.)

SendAsync(_HttpRequestMessage)

Overloaded. Send an HTTP request as an asynchronous operation.

SendAsync(_HttpRequestMessage,THttpCompletionOption)

Overloaded. Send an HTTP request as an asynchronous operation.

SendAsync(_HttpRequestMessage,THttpCompletionOption,_CancellationToken)

Overloaded. Send an HTTP request as an asynchronous operation.

SendAsync(_HttpRequestMessage,_CancellationToken)

Overloaded. Send an HTTP request as an asynchronous operation.

UnRegisterEventCallBack(ClrWString,Pointer)

Remove an event from the instance using the specified event name and function pointer which is the event handler. (Inherited from TClrBaseComponent.)

UnRegisterEventSource

Unregister the Delphi object which raised the .Net event handler. (Inherited from TClrBaseComponent.)

Top

See C:\Users\Public\Documents\CrystalNet Technologies\.Net VCL for Delphi Demo Folder after installation for examples of how to use this component.