Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Delphi 使用TRESTRequest添加参数_Delphi_Delphi Xe7 - Fatal编程技术网

Delphi 使用TRESTRequest添加参数

Delphi 使用TRESTRequest添加参数,delphi,delphi-xe7,Delphi,Delphi Xe7,我在编译这部分代码时遇到了一些问题: RESTRequest.AddParameter('Id',edtId.Text,TRESTRequestParameterKind.pkGETorPOST); 它说: 未声明的标识符TRESTRequestParameterKind 我在表单上删除了以下组件: TRESTClient,TRESTRequest,TRestResponse 你知道我遗漏了什么或者为什么会有这个错误代码吗?你必须将REST.Types添加到你的uses子句中。嗨,Dalija

我在编译这部分代码时遇到了一些问题:

RESTRequest.AddParameter('Id',edtId.Text,TRESTRequestParameterKind.pkGETorPOST);
它说:

未声明的标识符TRESTRequestParameterKind

我在表单上删除了以下组件:
TRESTClient
TRESTRequest
TRestResponse


你知道我遗漏了什么或者为什么会有这个错误代码吗?

你必须将
REST.Types
添加到你的
uses
子句中。

嗨,Dalija,我现在有另一个问题,当我添加另一个参数时:RESTRequest.AddParameter('Id',edit1.Text,TRESTRequestParameterKind.pkGETorPOST);RESTRequest.AddParameter('Password',edit2.Text,TRESTRequestParameterKind.pkGETorPOST);RESTRequest1.Execute。这样我得到了一个错误:协议字段为空。PS:我仍然在使用DelphiXe7来实现android应用程序。知道问题出在哪里吗?您可能需要添加
RESTRequest.Method:=TRESTRequestMethod.rmPOST
RESTRequest.Method:=TRESTRequestMethod.rmGET谢谢你的支持Dalija,我是Delphi和REST技术的新手,如果我问了一个愚蠢的问题,请容忍我。再次感谢。问一些愚蠢的问题也没关系。但是,如果您尝试阅读文档并尝试查看Delphi提供的一些演示代码,则可以在开始时加快进度。