Class VpnHoodApiHttpFactory
- Namespace
- VpnHood.AppLib.Api.HttpClients
- Assembly
- VpnHood.AppLib.Api.HttpClients.dll
Provides the app's API for a UI that runs somewhere other than the app, as a paired browser, over HTTP calls to the app's web host.
public static class VpnHoodApiHttpFactory
- Inheritance
-
VpnHoodApiHttpFactory
- Inherited Members
Remarks
The clients it puts together answer the same six interfaces the app's in-process API does, so a UI cannot tell which one it was given. A failure the app's web host reports comes back as the exception it names, as the in-process call would have thrown it, and one this side cannot make as an ApiException.
Methods
Create(HttpClient)
Creates the app's API over HTTP.
public static VpnHoodApi Create(HttpClient httpClient)
Parameters
httpClientHttpClientThe HTTP client, whose base address is the app's web host and which carries the credential on every call: the local token as its bearer header on the device, the browser's cookie on a paired phone. The caller keeps and disposes it.
Returns
- VpnHoodApi
The app's API, whose calls go to the app over
httpClient.