Click or drag to resize

IHttpApiGetTData, TError Method (HttpApiGetRequest)

Make a GET request and return the data or error of the request

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
HttpApiResponse<TData, TError> Get<TData, TError>(
	HttpApiGetRequest httpApiGetRequest
)

Parameters

httpApiGetRequest
Type: Casewhere.Runtime.DSL.ApiHttpApiGetRequest
A GET request

Type Parameters

TData
The data type
TError
The error type

Return Value

Type: HttpApiResponseTData, TError
Return a HttpApiResponse
Examples
var httpApi = @apiFactory.Get<IHttpApi>();
var url = "https://login-demo.casewhere.com/admin/api/rest/v2/sharedconfigurablesettings";
var urlParameters = new Dictionary<string, string>();
urlParameters.Add("sortOrder", "Ascending");
var additionalHeaders = new Dictionary<string, string>();
additionalHeaders.Add("Authorization", "eyJhbGciOiJSUzI1NiIsImtpZCI6...");
var httpResponse = httpApi.Get<JObject, string>(HttpApiRequest.CreateGetRequest(url, urlParameters, additionalHeaders));
Log.Info("Response: {@response}", httpResponse);
See Also