Hello,
I’ve an application for iOS and Android. The code is exactly the same for both devices.
I’m trying to make a POST request on my local API. It’s perfectly working on iOS but in Android it’s look like I cannot set the headers with fetch.
handleActions = async ({ action, id }) => {
const result = await fetch('http://url', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
action,
ids: [id]
})
});
const json = await result.json();
console.log(json);
};
I’ve a 200 on iOS but a 415 on Android with this code.
Do you have a solution ?
Thanks.