我试图使用Delphi XE8 RESTClient、RESTRequest和RESTResponse来对以下API调用提供响应的内容:
https://api.hubapi.com/contacts/v1/lists/all/contacts/all?hapikey=Demo&count=1000
调用在C#和The浏览器中运行良好。
我不知道如何配置RESTClient和RESTRequest属性。
有人能为我将API调用分解为RESTClient & RESTRequest属性吗?
我已经和这个搏斗了好几个小时,但到目前为止还没有成功。
发布于 2015-04-25 19:28:52
下面是为REST组件分配属性的一个简单示例。
创建一个新项目并删除表单上的Button、RESTClient、RESTRequest、RESTResponse和Memo --您可以在Button事件上使用下面的代码来查看它的工作情况。
procedure TForm1.Button1Click(Sender: TObject);
begin
RESTRequest1.Client := RESTClient1;
RESTRequest1.Response := RESTResponse1;
RESTClient1.BaseURL := 'https://api.hubapi.com';
RESTRequest1.Resource :=
'contacts/v1/lists/all/contacts/all?hapikey=Demo&count=1000';
RESTRequest1.Execute;
Memo1.Text := RESTResponse1.Content;
end;https://stackoverflow.com/questions/29868010
复制相似问题