(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_CkHttp.h>
void ChilkatSample(void)
{
HCkHttp http;
const char *jsonStr;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http = CkHttp_Create();
CkHttp_SetRequestHeader(http,"Authorization","YOUR_REST_KEY");
jsonStr = CkHttp_quickGetStr(http,"https://api2.isbndb.com/book/9780134093413");
if (CkHttp_getLastMethodSuccess(http) == FALSE) {
printf("%s\n",CkHttp_lastErrorText(http));
CkHttp_Dispose(http);
return;
}
printf("Response status code: %d\n",CkHttp_getLastStatus(http));
printf("Response JSON:\n");
printf("%s\n",jsonStr);
CkHttp_Dispose(http);
}
|