Added application json content type headaer

This commit is contained in:
2019-10-31 19:16:18 +01:00
parent 470bcdd72e
commit 755bd116d5

View File

@@ -140,9 +140,16 @@ const addMagnet = (magnet, name, tmdb_id) => {
name: name,
tmdb_id: tmdb_id
})
const headers = { authorization: storage.token }
const headers = {
'Content-Type': 'application/json',
authorization: storage.token
}
return fetch(url.href, { method: 'POST', headers, body })
return fetch(url.href, {
method: 'POST',
headers,
body
})
.then(resp => resp.json())
.catch(error => { console.error(`api error adding magnet: ${name} ${error}`); throw error })
}