delphimvcframework/samples/basicdemo_vclclient/Unit1.pas

51 lines
984 B
ObjectPascal
Raw Normal View History

unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
2016-12-12 14:37:20 +01:00
Button2: TButton;
procedure Button1Click(Sender: TObject);
2016-12-12 14:37:20 +01:00
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses
2020-09-24 21:30:45 +02:00
MVCFramework.RESTClient.Intf,
2020-09-03 19:57:00 +02:00
MVCFramework.RESTClient;
{$R *.dfm}
2016-12-12 14:37:20 +01:00
procedure TForm1.Button1Click(Sender: TObject);
var
2020-09-24 21:30:45 +02:00
Clt: IMVCRESTClient;
begin
2020-09-24 21:30:45 +02:00
Clt := TMVCRESTClient.New.BaseURL('http://localhost', 8080);
ShowMessage(Clt.Get('/div/10/20').Content);
end;
2016-12-12 14:37:20 +01:00
procedure TForm1.Button2Click(Sender: TObject);
var
2020-09-24 21:30:45 +02:00
Clt: IMVCRESTClient;
2016-12-12 14:37:20 +01:00
begin
2020-09-24 21:30:45 +02:00
Clt := TMVCRESTClient.New.BaseURL('http://localhost', 8080);
ShowMessage(Clt.Post('/hello', '{"name":"Bob <20><><EFBFBD><EFBFBD>"}').Content);
2016-12-12 14:37:20 +01:00
end;
end.