Class ServiceHttpClientWrapper
A wrapper for "IServiceHttpClient".
Implements
Namespace: Unity.DigitalTwins.Live.Sdk.Implementations
Assembly: solution.dll
Syntax
public class ServiceHttpClientWrapper : IServiceHttpClientWrapper
Constructors
ServiceHttpClientWrapper(EnvironmentSettings, IServiceHttpClient)
Declaration
public ServiceHttpClientWrapper(EnvironmentSettings environmentSettings, IServiceHttpClient serviceHttpClient)
Parameters
Type | Name | Description |
---|---|---|
EnvironmentSettings | environmentSettings | |
IServiceHttpClient | serviceHttpClient |
Methods
DeleteAsync<T>(String, IDictionary<String, String>)
Represents the DELETE method.
Declaration
public async Task<Optional<T>> DeleteAsync<T>(string endpoint, IDictionary<string, string> headers = null)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The api endpoint. |
IDictionary<String, String> | headers | The header of the HTTP request. |
Returns
Type | Description |
---|---|
Task<Optional<T>> |
Type Parameters
Name | Description |
---|---|
T | The type of returned content. |
GetAsync<T>(String, IDictionary<String, String>)
Represents the GET method.
Declaration
public async Task<Optional<T>> GetAsync<T>(string endpoint, IDictionary<string, string> headers = null)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The api endpoint. |
IDictionary<String, String> | headers | The header of the HTTP request. |
Returns
Type | Description |
---|---|
Task<Optional<T>> |
Type Parameters
Name | Description |
---|---|
T | The type of returned content. |
PostAsync<T>(String, Object, IDictionary<String, String>)
Represents the POST method.
Declaration
public async Task<Optional<T>> PostAsync<T>(string endpoint, object payload, IDictionary<string, string> headers = null)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The api endpoint. |
Object | payload | The body of the HTTP request. |
IDictionary<String, String> | headers | The header of the HTTP request. |
Returns
Type | Description |
---|---|
Task<Optional<T>> |
Type Parameters
Name | Description |
---|---|
T | The type of returned content. |
PutAsync<T>(String, Object, IDictionary<String, String>)
Represents the PUT method.
Declaration
public async Task<Optional<T>> PutAsync<T>(string endpoint, object payload, IDictionary<string, string> headers = null)
Parameters
Type | Name | Description |
---|---|---|
String | endpoint | The api endpoint. |
Object | payload | The body of the HTTP request. |
IDictionary<String, String> | headers | The header of the HTTP request. |
Returns
Type | Description |
---|---|
Task<Optional<T>> |
Type Parameters
Name | Description |
---|---|
T | The type of returned content. |