GetResponseJson
Gets a JSON formatted document via HTTP.
| Service | Operation |
|---|---|
| httpClient | GET_RESPONSE_JSON |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Cloud Code
- Raw
//Switch to CC tab
//Switch to CC tab
//Switch to CC tab
//Switch to CC tab
//Switch to CC tab
var serviceCode = "webService";
var path = "resource/dir";
var query = {
"parmName": "value"
};
var headers = {
"headerName": "value"
};
var httpClientProxy = bridge.getHttpClientServiceProxy();
var postResult = httpClientProxy.getResponseJson(serviceCode, path, query, headers);
if (postResult.status == 200) {
// Success!
}
var serviceCode = "webService";
var path = "resource/dir";
var query = {
"parmName": "value"
};
var headers = {
"headerName": "value"
};
var httpClientProxy = bridge.getHttpClientServiceProxy();
var postResult = httpClientProxy.getResponseJson(serviceCode, path, query, headers);
if (postResult.status == 200) {
// Success!
}
JSON Response
{
"status": 200,
"data": {
"statusCode": 200,
"json": {
"key": "value"
}
}
}
Method Parameters
| Parameter | Description |
|---|---|
| serviceCode | Service code of the external service configured in the Cloud Code - Web Services section of the portal |
| path | Path to append to the Base URL of the service |
| query | Map of query parameters |
| headers | Map of extra headers |