Back to Collection Items
#include <CkHttpW.h>
#include <CkStringBuilderW.h>
void ChilkatSample(void)
{
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkHttpW http;
bool success;
http.SetRequestHeader(L"Content-Type",L"application/json");
CkStringBuilderW sbResponseBody;
success = http.QuickGetSb(L"https://domain.com/dapi/v1/premiumIndex",sbResponseBody);
if (success == false) {
wprintf(L"%s\n",http.lastErrorText());
return;
}
wprintf(L"Response status code = %d\n",http.get_LastStatus());
wprintf(L"%s\n",sbResponseBody.getAsString());
}
Curl Command
curl -X GET
-H "Content-Type: application/json"
https://domain.com/dapi/v1/premiumIndex
Postman Collection Item JSON
{
"name": "Index Price and Mark Price",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/dapi/v1/premiumIndex",
"host": [
"{{url}}"
],
"path": [
"dapi",
"v1",
"premiumIndex"
],
"query": [
{
"key": "symbol",
"value": "",
"disabled": true
},
{
"key": "pair",
"value": "",
"disabled": true
}
]
}
},
"response": [
]
}