For some reason when sending off requests from an actual android device using React Native as a POST the server only receives GET requests. Can someone explain why this is happening and how to prevent the protocol switching? I read somewhere that specifying the HEADERS will help fix this but not true. Have any others also experienced this anomaly?
addTask = async (title, imgFile) => {
var formData = new FormData();
formData.append("json", JSON.stringify({ title: title, status: "New", priority: "Normal" }));
axios.request({
url: API_URL + 'tasks',
method: 'post',
data: formData,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
}).then(response => {
console.log('response', response);
});
}