I am attempting to populate formData with data using the following method:
params = {'code': 'h1'}
const formData: FormData = new FormData();
formData.append('parameters', JSON.stringify(params));
Once I attempt to access the data from formData like this: formData['parameters']
, it comes back as undefined
and formData.entries.length
is 0
.
I have checked various sources and they all suggest that this is the correct approach.
Can anyone advise on what might be going wrong?
Many thanks.