(Unicode C) ISBNdb API v2 Get Book Details
Demonstrates how to send a GET request to the ISBNdb API v2 with Authorization header. For more information, see https://isbndb.com/apidocs/v2#examples
#include <C_CkHttpW.h>
void ChilkatSample(void)
{
HCkHttpW http;
const wchar_t *jsonStr;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttpW_Create();
CkHttpW_SetRequestHeader(http,L"Authorization",L"YOUR_REST_KEY");
jsonStr = CkHttpW_quickGetStr(http,L"https://api2.isbndb.com/book/9780134093413");
if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
wprintf(L"%s\n",CkHttpW_lastErrorText(http));
CkHttpW_Dispose(http);
return;
}
wprintf(L"Response status code: %d\n",CkHttpW_getLastStatus(http));
wprintf(L"Response JSON:\n");
wprintf(L"%s\n",jsonStr);
CkHttpW_Dispose(http);
}
|