Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/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
能否在REST调试器中传递TJSONObject_Rest_Delphi - Fatal编程技术网

能否在REST调试器中传递TJSONObject

能否在REST调试器中传递TJSONObject,rest,delphi,Rest,Delphi,调用此使用Delphi创建的REST服务不需要身份验证。 客户机类API有文档记录(ClientClassesUnit1.pas) 但是我想使用DelphiREST调试器创建一个测试,我无法确定实用程序中的设置应该是什么。。。或者即使REST调试器能够这样做。邮递员工具似乎也不起作用 我试图发布一张照片,但由于公司政策的限制,无法发布 方法:POST URL:https://wxdf0-servername.com/snap4.dll/datasnap/rest/TGeneral/UpdatCI

调用此使用Delphi创建的REST服务不需要身份验证。 客户机类API有文档记录(ClientClassesUnit1.pas)

但是我想使用DelphiREST调试器创建一个测试,我无法确定实用程序中的设置应该是什么。。。或者即使REST调试器能够这样做。邮递员工具似乎也不起作用

我试图发布一张照片,但由于公司政策的限制,无法发布

方法:
POST

URL:
https://wxdf0-servername.com/snap4.dll/datasnap/rest/TGeneral/UpdatCIM2

内容类型:
application/json

自定义主体(已编辑)

我在调试器上得到的全部回报是“500:内部服务器错误”


调用使用TJSONObject作为参数的Delphi REST调用的正确设置(如果可能)是什么?

JSON中的对象被您省略的
{}
包围。此外,属性之间用逗号分隔

{
“数据”:{
“阶段”:“7”,
“步骤”:“1”
}
}

Content-type:application/json如果连邮递员都无法工作,那么您很可能就是没有发送REST服务器实际期望的内容;如果有数据问题,它会发回异常消息;函数返回一个字符串。它与POST函数和GET函数有关—没有POST和REST调试器使用的示例。所有这些似乎都是GET Calls请显示您的服务器代码。如果你甚至不能让邮递员工作,你希望如何让你的Delphi代码工作;它已经与30万客户合作多年。我正在尝试让“REST调试器”或Postman使用TJSONObject,以便在Delphi代码之外使用其中一个作为测试工具。添加了逗号和括号,但仍然存在错误
    function TGeneralClient.UpdateCIM2(PostData : TJSONOjbect; const ARequestFilter:string):string
    begin
      if FUpdateCIM2Command = nil then
      begin 
        FUpdateCIM2Command := FConnection.CreateCommand;
        FUpdateCIM2Command.RequestType := 'POST';
        FUpdateCIM2Command.Text := 'TGeneral."UpdateCIM2"';
        FUpdateCIM2Command.Prepare(TGeneral_UpdteCIM2);
      end;
      FUpdateCIM2Command.Parameters[0].Value.SetJSONValue(PostData,FInstanceOwner);
      FUpdateCIM2Command.Execute(ARequestFilter);
      Result := FUpdateCIM2Command.Parmeters[1].Value.GetWideString;
    end;
         {
           "data" :{
              "Stage" :"7",
                 "Step" :"1"
          }
        }