C# Класс HaloEzAPI.Limits.RequestRateHttpClient

Responsible for handling all Http Request to the API, via a Semaphore and Stopwatch system to prevent excessive requests.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
SecondsLimit int

Открытые методы

Метод Описание
GetRequest ( Uri endpoint ) : Task

Goes to make a Get requst to the specifed Uri, only if it hasn't exceeded the call limit

SetAPIToken ( string token ) : void

Set the API Token Header in the HttpClient

SetRequestLimit ( int limit ) : void

Recreates the Semaphore, and reassigns a Limit

SetSecondsLimit ( int limit ) : void

Assigns a new seconds limit

Приватные методы

Метод Описание
RequestRateHttpClient ( ) : System

Описание методов

GetRequest() публичный статический Метод

Goes to make a Get requst to the specifed Uri, only if it hasn't exceeded the call limit
public static GetRequest ( Uri endpoint ) : Task
endpoint System.Uri Endpoint to request
Результат Task

SetAPIToken() публичный статический Метод

Set the API Token Header in the HttpClient
public static SetAPIToken ( string token ) : void
token string Your Halo Developer API Token
Результат void

SetRequestLimit() публичный статический Метод

Recreates the Semaphore, and reassigns a Limit
public static SetRequestLimit ( int limit ) : void
limit int Request limit
Результат void

SetSecondsLimit() публичный статический Метод

Assigns a new seconds limit
public static SetSecondsLimit ( int limit ) : void
limit int Seconds limit
Результат void

Описание свойств

SecondsLimit публичное статическое свойство

Number of seconds the for the Limit of requests (10 seconds for 10 requests etc)
public static int SecondsLimit
Результат int