找到原因:: procedure TKinveyApi.QueryResource(const AResource: string; const AQuery: array of string; const AJSONArray: TJSONArray; AReset: Boolean); var LRoot: TJSONArray; S: String; I: Integer; LTrim: string; LJSONValue: TJSONValue; LResponse: TJSONObject; begin if AReset then begin FRequest.ResetToDefaults; AddAuthParameter; end; FRequest.Method := TRESTRequestMethod.rmGET; FRequest.Resource := AResource;
for S in AQuery do begin LTrim := Trim(S); if LTrim = '' then continue; I := LTrim.IndexOf('='); if I > 0 then FRequest.AddParameter(S.Substring(0, I).Trim, S.Substring(I+1).Trim); end;
FRequest.Execute; CheckForResponseError([404]); // 404 = not found if AJSONArray <> nil then if FRequest.Response.StatusCode <> 404 then begin try LRoot := FRequest.Response.JSONValue as TJSONArray; for LJSONValue in LRoot do AJSONArray.AddElement(TJSONValue(LJSONValue.Clone)) except LResponse := FRequest.Response.JSONValue as TJSONObject; if Assigned(AJSONArray) then AJSONArray.AddElement(LResponse.Clone as TJSONObject); end; end; end;
----------------------------------------------
相信自己,若自己都不相信,那还有谁可信。