Ionic form-data is not uploading

Hi All,

I tried to upload my image file using REST api with form data but every time i get this below error.

TypeError: Cannot read property ‘length’ of undefined
at (vendor.js:7159)
at Array.forEach ()
at HttpHeaders.lazyInit (vendor.js:7151)
at HttpHeaders.init (vendor.js:7267)
at HttpHeaders.forEach (vendor.js:7357)
at Observable.rxjs__WEBPACK_IMPORTED_MODULE_1__.Observable [as _subscribe] (vendor.js:8756)
at Observable._trySubscribe (vendor.js:100672)
at Observable.subscribe (vendor.js:100658)
at subscribeToResult (vendor.js:110705)
at MergeMapSubscriber._innerSub (vendor.js:105935)

I have no clue why this is happening. Please help