Swift
Swift
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 Swift Downloads
func chilkatTest() {
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
let http = CkoHttp()!
http.setRequestHeader(name: "Authorization", value: "YOUR_REST_KEY")
var jsonStr: String? = http.quickGetStr(url: "https://api2.isbndb.com/book/9780134093413")
if http.lastMethodSuccess == false {
print("\(http.lastErrorText!)")
return
}
print("Response status code: \(http.lastStatus.intValue)")
print("Response JSON:")
print("\(jsonStr!)")
}