Table of Contents

Interface IHttpInvoker

Namespace
Geotab.Checkmate.Web
Assembly
Geotab.Checkmate.ObjectModel.dll

An interface that makes HTTP calls to a remote service.

public interface IHttpInvoker

Methods

Invoke(string, string, object?)

Invokes the remote HTTP service and returns the response as an object. Note this method is deprecated. Rather use InvokeAsync(string, string, object?, in CancellationToken)

Dictionary<string, object>? Invoke(string url, string method = "GET", object? payload = null)

Parameters

url string

The URL.

method string

The supported HTTP method.

payload object

The payload.

Returns

Dictionary<string, object>

The response object.

InvokeAsync(string, string, object?, in CancellationToken)

Invokes the remote HTTP service and returns the response as an object asynchronously.

Task<Dictionary<string, object>?> InvokeAsync(string url, string method = "GET", object? payload = null, in CancellationToken cancellationToken = default)

Parameters

url string

The URL.

method string

The supported HTTP method.

payload object

The optional post payload.

cancellationToken CancellationToken

The optional CancellationToken used to signal that the request should be cancelled.

Returns

Task<Dictionary<string, object>>

The response object.