码迷,mamicode.com
首页 > 其他好文 > 详细

RESTClient 控件 从服务器获得数据集 REST

时间:2016-06-19 06:40:46      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:

用TRESTClient控件调用REST架构服务

RESTClient控件返回数据集

用到的控件

RESTClient

RESTRequest

RESTResponseDataSetAdapter

技术分享
procedure Tfrm_Main.btn_DataSet_FetchDataClick(Sender: TObject);
begin
  ResetRESTComponentsToDefaults;

  RESTResponseDataSetAdapter.Response:= RESTResponse;
  RESTResponseDataSetAdapter.Dataset:= ClientDataSet;

  RESTClient.BaseURL := edt_DataSet_BaseURL.Text;   //http://www.developer-experts.net/hdmobile/api/
  RESTRequest.Resource := edt_DataSet_ResourceURI.Text;  //mandators
  RESTRequest.Execute;
end;
技术分享

 

官方例子Studio\14.0\Samples\Object Pascal\Database\RESTDemo

D:\Documents\Embarcadero\Studio\14.0\Samples\Object Pascal\Database\RESTDemo

技术分享 View Code

 

 

http://community.embarcadero.com/blogs/entry/rad-studio-10-1-berlin-rest-json-and-using-a-fun-site-name2gender-com

 RESTRequest1->AddParameter("Name",UpperCase(Edit1->Text));
  RESTRequest1->Execute();
  RESTStatusLabel->Text = IntToStr(RESTResponse1->StatusCode)+"/"+RESTResponse1->StatusText;
  Memo1->Lines->Add(RESTResponse1->JSONText);


RESTRequest1.Params[0].Value := UpperCase(Edit1.Text);
  RESTRequest1.Execute();
  RESTStatusLabel.Text := IntToStr(RESTResponse1.StatusCode)+‘/‘+RESTResponse1.StatusText;
  Memo1.Lines.Add(RESTResponse1.JSONText);

http://www.cnblogs.com/cb168/p/3887269.html

RESTClient 控件 从服务器获得数据集 REST

标签:

原文地址:http://www.cnblogs.com/findumars/p/5597296.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!