C# Class HaloEzAPI.Limits.RequestRateHttpClient

Responsible for handling all Http Request to the API, via a Semaphore and Stopwatch system to prevent excessive requests.
Afficher le fichier Open project: glitch100/Halo-API

Méthodes publiques

Свойство Type Description
SecondsLimit int

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
RequestRateHttpClient ( ) : System

Method Details

GetRequest() public static méthode

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
Résultat Task

SetAPIToken() public static méthode

Set the API Token Header in the HttpClient
public static SetAPIToken ( string token ) : void
token string Your Halo Developer API Token
Résultat void

SetRequestLimit() public static méthode

Recreates the Semaphore, and reassigns a Limit
public static SetRequestLimit ( int limit ) : void
limit int Request limit
Résultat void

SetSecondsLimit() public static méthode

Assigns a new seconds limit
public static SetSecondsLimit ( int limit ) : void
limit int Seconds limit
Résultat void

Property Details

SecondsLimit public_oe static_oe property

Number of seconds the for the Limit of requests (10 seconds for 10 requests etc)
public static int SecondsLimit
Résultat int