Sample code for 30+ languages & platforms
PureBasic

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 PureBasic Downloads

PureBasic
IncludeFile "CkHttp.pb"

Procedure ChilkatExample()

    ; This example assumes the Chilkat API to have been previously unlocked.
    ; See Global Unlock Sample for sample code.

    http.i = CkHttp::ckCreate()
    If http.i = 0
        Debug "Failed to create object."
        ProcedureReturn
    EndIf

    CkHttp::ckSetRequestHeader(http,"Authorization","YOUR_REST_KEY")
    jsonStr.s = CkHttp::ckQuickGetStr(http,"https://api2.isbndb.com/book/9780134093413")
    If CkHttp::ckLastMethodSuccess(http) = 0
        Debug CkHttp::ckLastErrorText(http)
        CkHttp::ckDispose(http)
        ProcedureReturn
    EndIf

    Debug "Response status code: " + Str(CkHttp::ckLastStatus(http))
    Debug "Response JSON:"
    Debug jsonStr


    CkHttp::ckDispose(http)


    ProcedureReturn
EndProcedure