let headers = new Headers();
headers.append('Accept', '*/*');
headers.append('Content-Type', 'multipart/form-data');
let payload = await this.http.fetch(path, {
method: 'post',
body: item,
headers: headers
}).then(response => response.json())
.catch(err => err);
I am creating this piece of code to post a file to the server. When making the request this converts the header from Content-Type to content-type, Accept to accept, and this is causing me problems, I am using Aurelia + TypeScript.
Any ideas to avoid this behavior?