Table of Contents

Class DomainBlacklistClient

Namespace
Nfield.SDK
Assembly
Nfield.Public.SDK.dll
public class DomainBlacklistClient
Inheritance
DomainBlacklistClient
Inherited Members

Constructors

DomainBlacklistClient(string, HttpClient)

public DomainBlacklistClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl string
httpClient HttpClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

string

JsonSerializerSettings

protected JsonSerializerSettings JsonSerializerSettings { get; }

Property Value

JsonSerializerSettings

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

bool

Methods

GetAsync(CancellationToken)

Downloads the blacklist for the domain.

public virtual Task<FileResponse> GetAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<FileResponse>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

PostAsync(FileParameter, CancellationToken)

Uploads the blacklist for the domain. Pass the data as a CSV formatted string in the body of the request or as a form file

public virtual Task<BlacklistUploadStatusResponseModel> PostAsync(FileParameter file = null, CancellationToken cancellationToken = default)

Parameters

file FileParameter
cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Task<BlacklistUploadStatusResponseModel>

Successful

Exceptions

NfieldSdkException

A server side error occurred.

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<string, IEnumerable<string>>, CancellationToken)

protected virtual Task<DomainBlacklistClient.ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<string, IEnumerable<string>> headers, CancellationToken cancellationToken)

Parameters

response HttpResponseMessage
headers IReadOnlyDictionary<string, IEnumerable<string>>
cancellationToken CancellationToken

Returns

Task<DomainBlacklistClient.ObjectResponseResult<T>>

Type Parameters

T