Sample code for 30+ languages & platforms
C

ISBNdb API v2 Get Book Details

See more HTTP Misc Examples

Demonstrates how to send a GET request to the ISBNdb API v2 with Authorization header.

Chilkat C Downloads

C
#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);

    }