Skip to content

[PATCH] Adding TResponse.JSONContent to httpdefs

Original Reporter info from Mantis: MarcusF
  • Reporter name: Marcus Fernstrom

Description:

Added ability to use TJSONData in content, also sets ContentType.

Example:

procedure jsonEndpoint(aRequest : TRequest; aResponse : TResponse);
var
  jObject : TJSONObject;
begin
  jObject := TJSONObject.Create;
  try
    jObject.Booleans['success'] := true;
    aResponse.JSONContent := jObject ;
    aResponse.SendContent;
  finally
    jObject.Free;
  end;
end;

Mantis conversion info:

  • Mantis ID: 38435
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information