-
Notifications
You must be signed in to change notification settings - Fork 2
HttpClientService
Sam Gerene edited this page May 21, 2018
·
2 revisions
The satsearch API is exposed over HTTP. The HttpClientService class is used to create a reusable instance of the HttpClient class. The HttpClientService implements the IHttpClientService interface and is injectable using MEF.
The IHttpClientService is a dependency of the SatSearchService, the SatSearchService uses it as a factory to create and request an HttpClient with the approriate HTTP headers set, such as the API-Tokens.
An API developer does not need to use HttpClientService directly, it only needs to be provided to the SatSearchService, preferable by means of dependency injection using a framework like MEF.
var uri = new Uri("https://api.satsearch.co");
var credentials = new Credentials("API-Token", "your-Application-Token", uri)
var httpClientService = HttpClientService();
var httpClient = httpClientService.QueryHttpClient(credentials);copyright @ RHEA System S.A.