Table of Contents

Class MassiveAuthenticationHandler

Namespace
MassiveDotNet.Http
Assembly
MassiveDotNet.dll

Attaches Massive platform credentials to every outbound request.

public sealed class MassiveAuthenticationHandler : DelegatingHandler, IDisposable
Inheritance
MassiveAuthenticationHandler
Implements
Inherited Members

Constructors

MassiveAuthenticationHandler(string, MassiveAuthenticationScheme)

Initializes a new instance of the MassiveAuthenticationHandler class.

public MassiveAuthenticationHandler(string apiKey, MassiveAuthenticationScheme scheme)

Parameters

apiKey string

The API key to present.

scheme MassiveAuthenticationScheme

How the key should be presented.

Exceptions

ArgumentException

apiKey is null or whitespace.

Methods

Send(HttpRequestMessage, CancellationToken)

Sends an HTTP request to the inner handler to send to the server.

protected override HttpResponseMessage Send(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

HttpResponseMessage

An HTTP response message.

Exceptions

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.

SendAsync(HttpRequestMessage, CancellationToken)

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request was null.

OperationCanceledException

The cancellation token was canceled. This exception is stored into the returned task.