httpGet
Runs an HTTP Get request and returns the HTTP response from the server.
The content type provided in the request's header is set by default to application/json. Use this function when the endpoint expects a JSON object parameter.
Syntax
Copy
function httpGet(url : string, obj : any, getOptions : IFtosHttpGetOptions): IFtosHttpResult
Parameter | Type | Description |
---|---|---|
url
|
string | The service endpoint's URI. For instance, the address of a REST API endpoint. |
obj optional |
any | Key-value pairs in JSON format to be passed in the request's body. |
getOptions optional |
IFtosHttpGetOptions | Additional options to be passed to the HTTP request. |
Type Aliases
Return Value
Returns the HTTP response of the HTTP Get request. For example:
Copy
{
"IsSuccess": true,
"Response": {
"access_token": "36db7a81-15ca-4957-9607-bbf446e6c3a9",
"expires_in": 1200.0,
"email": "host@change.me",
"error": null
},
"StatusCode": 200
}
If the response is returned in JSON format, the following properties are supported by the return value, corresponding to its first level keys: .IsSuccess, .Response, and .StatusCode.
NOTE
The
The
Response
key in the result is a JSON object, not a string as when using the callGetMethod function.