C# 클래스 HaloEzAPI.Limits.RequestRateHttpClient

Responsible for handling all Http Request to the API, via a Semaphore and Stopwatch system to prevent excessive requests.
파일 보기 프로젝트 열기: glitch100/Halo-API

공개 프로퍼티들

프로퍼티 타입 설명
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