Merge pull request #34 from KevinMidboe/fix/post-magnet-data
Added application json content type header
This commit is contained in:
11
src/api.js
11
src/api.js
@@ -140,9 +140,16 @@ const addMagnet = (magnet, name, tmdb_id) => {
|
|||||||
name: name,
|
name: name,
|
||||||
tmdb_id: tmdb_id
|
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())
|
.then(resp => resp.json())
|
||||||
.catch(error => { console.error(`api error adding magnet: ${name} ${error}`); throw error })
|
.catch(error => { console.error(`api error adding magnet: ${name} ${error}`); throw error })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user