(Delphi ActiveX) 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
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Chilkat_TLB;
...
procedure TForm1.Button1Click(Sender: TObject);
var
http: TChilkatHttp;
jsonStr: WideString;
begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
http := TChilkatHttp.Create(Self);
http.SetRequestHeader('Authorization','YOUR_REST_KEY');
jsonStr := http.QuickGetStr('https://api2.isbndb.com/book/9780134093413');
if (http.LastMethodSuccess = 0) then
begin
Memo1.Lines.Add(http.LastErrorText);
Exit;
end;
Memo1.Lines.Add('Response status code: ' + IntToStr(http.LastStatus));
Memo1.Lines.Add('Response JSON:');
Memo1.Lines.Add(jsonStr);
end;
|