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
  • 22,124
  • 4
  • 53
  • 77
Jansen Moscol
  • 307
  • 3
  • 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
  • 14,727
  • 3
  • 32
  • 51