6

I'm the only one who gets the empty formData {} after making an append I'm working with angular 2 the latest version.

let formData: FormData = new FormData()
   formData.append('key','value')
   console.log(formData)

Result:

FormData { }
Claies
  • 21,789
  • 3
  • 51
  • 76
Jansen Moscol
  • 197
  • 2
  • 5

1 Answers1

3

FormData is not plain js object, API link: https://developer.mozilla.org/ru/docs/Web/API/FormData

let data = new FormData();
data.append('key', 'value');
console.log(data.get('key'))
kemsky
  • 12,970
  • 3
  • 27
  • 47