(DataFlex) 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
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
String sJsonStr
String sTemp1
Integer iTemp1
Boolean bTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Send ComSetRequestHeader To hoHttp "Authorization" "YOUR_REST_KEY"
Get ComQuickGetStr Of hoHttp "https://api2.isbndb.com/book/9780134093413" To sJsonStr
Get ComLastMethodSuccess Of hoHttp To bTemp1
If (bTemp1 = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComLastStatus Of hoHttp To iTemp1
Showln "Response status code: " iTemp1
Showln "Response JSON:"
Showln sJsonStr
End_Procedure
|