IHttpApiGetTData, TError(HttpApiGetRequest) Method
|
Make a GET request and return the data or error of the request
Namespace: Casewhere.Runtime.DSL.ApiAssembly: Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.5.0
SyntaxHttpApiResponse<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
Examplevar 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