Jump to content

IanB

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Activity
    Developer

IanB's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. After a LOT of experimentation and analyzing network captures the following works: procedure TForm7.DoOnAuthorization(Sender: TObject; Authentication: TIdAuthentication; var Handled: Boolean); begin Authentication.Username := ShopKey; Authentication.Password := ''; Handled := true; end; procedure TForm7.DoOnSelectAuthorization(Sender: TObject; var AuthenticationClass: TIdAuthenticationClass; AuthInfo: TIdHeaderList); begin AuthenticationClass := TIdBasicAuthentication; end; procedure TForm7.FormCreate(Sender: TObject); var SSLHandler: TIdSSLIOHandlerSocketOpenSSL; s: string; begin Client := TIdHttp.Create(self); Client.OnAuthorization := DoOnAuthorization; Client.OnSelectAuthorization := DoOnSelectAuthorization; Client.HTTPOptions := Client.HTTPOptions + [hoInProcessAuth]; Client.Request.Accept := ''; Client.Request.AcceptEncoding := ''; Client.Request.UserAgent := ''; s := Client.Get('http://mysite.com/api'); end;
  2. Can someone give me an example of using Delphi (preferable TIdHttp) to access the PreastaShop API Cheers
×
×
  • Create New...