anchor.diff:    Result := TJsonListAdapter.Create(AList, AItemClass);
   end;
   
  +{ TMultiPartFormData }
  +
  +{$IFDEF SUPPORTS_GENERICS}
  +procedure TMultiPartFormData.AddFieldContent(Field: TRttiField; var Content: TStringList);
  +const
  +  FmtTextContent = 'Content-Disposition: form-data; name="%s"'+ sLineBreak+sLineBreak +'%s';
  +  FmtFileContent = 'Content-Disposition: form-data; name="%s"; filename="%s"'+ sLineBreak +'Content-Type: %s'+ sLineBreak+sLineBreak+ '%s';
  +var
  +  Attachment: TMultiPartFormAttachment;
  +begin
  +  if Field.FieldType.TypeKind in [tkString, tkUString, tkWChar, tkLString, tkWString, tkInteger, tkChar, tkWChar] then
  +  begin
  +    Content.Add(Format(FmtTextContent, [Field.Name, Field.GetValue(Self).AsString]));
  +    Exit;
  +  end;
  +
  +  if Field.FieldType.Name.Equals(TMultiPartFormAttachment.ClassName) then
  +  begin
  +    Attachment := Field.GetValue(Self).AsType<TMultiPartFormAttachment>;
  +    Content.Add(Format(FmtFileContent, [Field.Name, Attachment.FileName, Attachment.MimeType, Attachment.Content.DataString]));
  +  end;
  +end;
  +
  +function TMultiPartFormData.ContentAsString: string;
  +var
  +  vField: TRttiField;
  +  vContent: TStringList;
  +  vBoundary: string;
  +  vRttiContext: TRttiContext;
  +  vRttiType: TRttiType;
  +begin
  +  vBoundary := '--' + FBoundary;
  +
  +  vContent := TStringList.Create;
  +  try
  +    vContent.Add(vBoundary);
  +
  +    vRttiContext := TRttiContext.Create;
  +    vRttiType := vRttiContext.GetType(Self.ClassType);
  +    for vField in vRttiType.GetDeclaredFields do
  +    begin
  +      AddFieldContent(vField, vContent);
  +      vContent.Add(vBoundary);
  +    end;
  +
  +    vContent.Strings[Pred(vContent.Count)] := vBoundary + '--';
  +    Result := vContent.Text;
  +  finally
  +    vContent.Free;
  +  end;
  +end;
  +
  +constructor TMultiPartFormData.Create;
  +const
  +  FmtBoundary = 'boundary--%s';
  +  FmtContentType = 'multipart/form-data; boundary=%s';
  +var
  +  vGUID: TGUID;
  +begin
  +  CreateGUID(vGUID);
  +  FBoundary := Format(FmtBoundary, [GUIDToString(vGUID)]);
  +  FContentType := Format(FmtContentType, [FBoundary]);
  +end;
  +
  +constructor TMultiPartFormAttachment.Create(Source: TStream; MimeType, FileName: string);
  +begin
  +  Create(MimeType, FileName);
  +  FContent.LoadFromStream(Source);
  +end;
  +
  +constructor TMultiPartFormAttachment.Create(FilePath, MimeType, FileName: string);
  +begin
  +  Create(MimeType, FileName);
  +  FContent.LoadFromFile(FilePath);
  +end;
  +
  +constructor TMultiPartFormAttachment.Create(MimeType, FileName: string);
  +begin
  +  FContent := TStringStream.Create;
  +  FMimeType := MimeType;
  +  FFileName := FileName;
  +end;
  +
  +destructor TMultiPartFormAttachment.Destroy;
  +begin
  +  FContent.Free;
  +  inherited;
  +end;
  +{$ENDIF}
  +
   end.
  
positive.code: 
  procedure TResource.SetContent(entity: TObject);
  var
    vJson: string;
    vStream: TStringStream;
  begin
    FContent.Clear;
    if Assigned(entity) then
    begin
       vJson := TJsonUtil.Marshal(Entity);
  
      vStream := TStringStream.Create(vJson);
      try
        vStream.Position := 0;
        FContent.CopyFrom(vStream, vStream.Size);
      finally
        vStream.Free;
      end;
    end;
  end;
  
  
negative.code:     function GetAsDataSet(const RootElement: String): TDataSet;overload;
      {$ENDIF}
    end;
  
    {$IFDEF SUPPORTS_GENERICS}
    TMultiPartFormAttachment = class
    private
      FFileName: string;
      FMimeType: string;
      FContent: TStringStream;
    public
      constructor Create(MimeType, FileName: string); overload;
      constructor Create(Source: TStream; MimeType, FileName: string); overload;
      constructor Create(FilePath, MimeType, FileName: string); overload;
      destructor Destroy; override;
      property Content: TStringStream read FContent write FContent;
      property MimeType: string read FMimeType write FMimeType;
      property FileName: string read FFileName write FFileName;
    end;
  
    TMultiPartFormData = class
    private
      FBoundary: string;
      FContentType: string;
      procedure AddFieldContent(Field: TRttiField; var Content: TStringList);
    public
      constructor Create;
      function ContentAsString: string;
      property ContentType: string read FContentType;
    end;
    {$ENDIF}
  
  implementation
  
  