Back to Collection Items
#include <CkHttp.h>
#include <CkJsonObject.h>
#include <CkHttpResponse.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttp http;
bool success;
http.put_BasicAuth(true);
http.put_Login("{{secretId}}");
http.put_Password("{{secretPassword}}");
CkJsonObject queryParams;
queryParams.UpdateInt("page",1);
CkHttpResponse *resp = http.QuickRequestParams("GET","https://domain.com/investments/portfolios/",queryParams);
if (http.get_LastMethodSuccess() == false) {
std::cout << http.lastErrorText() << "\r\n";
return;
}
std::cout << resp->get_StatusCode() << "\r\n";
std::cout << resp->bodyStr() << "\r\n";
delete resp;
}
Curl Command
curl -G -d "page=1"
-u '{{secretId}}:{{secretPassword}}'
https://domain.com/investments/portfolios/
Postman Collection Item JSON
{
"name": "List",
"request": {
"method": "GET",
"header": [
],
"url": {
"raw": "{{baseUrl}}/investments/portfolios/?page=1",
"host": [
"{{baseUrl}}"
],
"path": [
"investments",
"portfolios",
""
],
"query": [
{
"key": "page",
"value": "1"
}
]
}
},
"response": [
]
}