Back to Collection Items
#include <CkHttp.h>
#include <CkStringBuilder.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.SetRequestHeader("Authorization","Basic dGVzdGluZzp0ZXN0aW5nMTIz");
http.SetRequestHeader("Content-Type","application/json");
CkStringBuilder sbResponseBody;
success = http.QuickGetSb("https://domain.com/bin/{{merchid}}/{{token}}",sbResponseBody);
if (success == false) {
std::cout << http.lastErrorText() << "\r\n";
return;
}
std::cout << "Response status code = " << http.get_LastStatus() << "\r\n";
std::cout << sbResponseBody.getAsString() << "\r\n";
}
Curl Command
curl -X GET
-H "Authorization: Basic dGVzdGluZzp0ZXN0aW5nMTIz"
-H "Content-Type: application/json"
https://domain.com/bin/{{merchid}}/{{token}}
Postman Collection Item JSON
{
"name": "Bin (Token)",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Basic dGVzdGluZzp0ZXN0aW5nMTIz"
},
{
"key": "Content-Type",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/bin/{{merchid}}/{{token}}",
"host": [
"{{url}}"
],
"path": [
"bin",
"{{merchid}}",
"{{token}}"
]
},
"description": "[Bin Documentation](https://developer.cardconnect.com/cardconnect-api#bin)"
},
"response": [
]
}