var
BytesRead,
ChunkSize : Integer;
DataPacket: array of Byte;
begin
BytesRead := Length(Request.Content);
if BytesRead < Request.ContentLength then
SetLength(DataPacket, Request.ContentLength)
else
SetLength(DataPacket, BytesRead);
Move(Request.Content[1], DataPacket[0], BytesRead);
if BytesRead < Request.ContentLength then
begin
repeat
ChunkSize := Request.ReadClient(Pointer(@Datapacket[BytesRead])^, Request.ContentLength - BytesRead);
if ChunkSize > 0 then
begin
Inc(BytesRead, ChunkSize);
end;
until ChunkSize = -1;
end;
end;