Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm9.btnGETClick(Sender: TObject);
- begin
- var lClient: IMVCRESTClient := TMVCRESTClient.Create;
- lClient.Async(
- procedure(Resp: IMVCRESTResponse)
- begin
- Memo1.Lines.Text := Resp.Content;
- end,
- procedure(E: Exception)
- begin
- Memo1.Lines.Clear;
- Memo1.Lines.Add('ERROR');
- Memo1.Lines.Add(E.ClassName + ': ' + E.Message)
- end,
- True).Get('https://httpbin.org/get');
- end;
- procedure TForm9.btnPOSTClick(Sender: TObject);
- begin
- var lClient: IMVCRESTClient := TMVCRESTClient.Create;
- lClient.Async(
- procedure(Resp: IMVCRESTResponse)
- begin
- Memo1.Lines.Text := Resp.Content;
- end,
- procedure(E: Exception)
- begin
- Memo1.Lines.Clear;
- Memo1.Lines.Add('ERROR');
- Memo1.Lines.Add(E.ClassName + ': ' + E.Message)
- end, True)
- .Post('https://httpbin.org/post', 'HELLO WORLD', TMVCMediaType.TEXT_PLAIN);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement