Use Delphi Client API

The generated delphi api dir structure is

   uUserItem.pas
   uUserItemAPI.pas

How to use it:

  1. Create A Client instance
  2. Create named request instance
  3. Set request param values
  4. call request
  5. Use the return values

Here is a code snippet:

  uses
    Classes, uUserItem, uUserItemAPI, uHttpApiBase;


  var
    req   : TUserItemGetAction;
    client: THttpAPIClientInfo;
  begin

    client := THttpAPIClientInfo.Create;
    client.sServerURI := 'http://127.0.0.1:8001/api/';
    req := TUserItemGetAction.Create(client);
    req.sUserName := 'test';
    try
      if req.execute then
      begin
        lblEmail.Text := req.getResult.sEmail;
      end else begin
        lblError.Text := req.getErrorMessage;
      end;
    finally
      req.Free;
      client.Free;
    end;  
  end;