You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function TRESTClient.DataSetInsert(const AResource: string; ADataSet: TDataSet; AFieldNamePolicy: TFieldNamePolicy)
: IRESTResponse;
begin
Result := doPOST(AResource, [], ADataSet.AsJSONObjectString(False, AFieldNamePolicy));
end;
Add TFieldNamePolicy
function TDataSetHelper.AsJSONObjectString(AReturnEmptyStringIfEOF: boolean; AFieldNamePolicy: TFieldNamePolicy): string;
var
JObj: TJSONObject;
begin
JObj := AsJSONObject(True, AFieldNamePolicy);
if not Assigned(JObj) then
begin
if AReturnEmptyStringIfEOF then
Result := ''
else
Result := '{}';
end
else
try
{ .$IFDEF TOJSON }
Result := JObj.ToJSON;
{ .$ELSE }
// Result := JObj.ToString
{ .$IFEND }
finally
JObj.Free;
end;
end;
The text was updated successfully, but these errors were encountered:
Error in unitest:
function TRESTClient.DataSetInsert(const AResource: string; ADataSet: TDataSet; AFieldNamePolicy: TFieldNamePolicy)
: IRESTResponse;
begin
Result := doPOST(AResource, [], ADataSet.AsJSONObjectString(False, AFieldNamePolicy));
end;
Add TFieldNamePolicy
The text was updated successfully, but these errors were encountered: