Kinetica   C#   API  Version 7.2.3.1
IHttpTransport Interface Reference

Abstraction over the raw HTTP POST layer. More...

+ Inheritance diagram for IHttpTransport:

Public Member Functions

byte [] Post (string url, byte[] body, string contentType, string? authorization, CancellationToken cancellationToken)
 Synchronous POST. More...
 
Task< byte[]> PostAsync (string url, byte[] body, string contentType, string? authorization, CancellationToken cancellationToken)
 Asynchronous POST. More...
 

Detailed Description

Abstraction over the raw HTTP POST layer.

Default implementation uses HttpClientTransport; tests can inject a fake.

Definition at line 10 of file IHttpTransport.cs.

Member Function Documentation

◆ Post()

byte [] IHttpTransport.Post ( string  url,
byte []  body,
string  contentType,
string?  authorization,
CancellationToken  cancellationToken 
)

Synchronous POST.

Blocks the calling thread until the response is received.

Parameters
urlFull URL to POST to
bodyRequest body bytes
contentTypeContent-Type header value
authorizationAuthorization header value (optional)
cancellationTokenCancellation token
Returns
Response body bytes

Implemented in HttpClientTransport.

◆ PostAsync()

Task<byte[]> IHttpTransport.PostAsync ( string  url,
byte []  body,
string  contentType,
string?  authorization,
CancellationToken  cancellationToken 
)

Asynchronous POST.

Returns a task that completes when the response is received.

Cancellation is honoured at the socket level — the returned task throws OperationCanceledException when the token fires.

Parameters
urlFull URL to POST to
bodyRequest body bytes
contentTypeContent-Type header value
authorizationAuthorization header value (optional)
cancellationTokenCancellation token
Returns
Task that returns response body bytes

Implemented in HttpClientTransport.


The documentation for this interface was generated from the following file: