Class DomainBlacklistClient
public class DomainBlacklistClient
- Inheritance
-
DomainBlacklistClient
- Inherited Members
Constructors
DomainBlacklistClient(string, HttpClient)
public DomainBlacklistClient(string baseUrl, HttpClient httpClient)
Parameters
baseUrlstringhttpClientHttpClient
Properties
BaseUrl
public string BaseUrl { get; set; }
Property Value
JsonSerializerSettings
protected JsonSerializerSettings JsonSerializerSettings { get; }
Property Value
- JsonSerializerSettings
ReadResponseAsString
public bool ReadResponseAsString { get; set; }
Property Value
Methods
GetAsync(CancellationToken)
Downloads the blacklist for the domain.
public virtual Task<FileResponse> GetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA 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
fileFileParametercancellationTokenCancellationTokenA 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
responseHttpResponseMessageheadersIReadOnlyDictionary<string, IEnumerable<string>>cancellationTokenCancellationToken
Returns
Type Parameters
T