IHttp ApiGetTData, TError(Http Api Get Request) Method
Make a GET request and return the data or error of the request
Definition
Namespace: Casewhere.Runtime.DSL.Api
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
Return a HttpApiResponse
Assembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.9.8.6
C#
HttpApiResponse<TData, TError> Get<TData, TError>(
HttpApiGetRequest httpApiGetRequest
)
Parameters
- httpApiGetRequest HttpApiGetRequest
- A GET request
Type Parameters
- TData
- The data type
- TError
- The error type
Return Value
HttpApiResponseTData, TErrorReturn a HttpApiResponse
Example
C#
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);