Code so far :
fetch('http:/example.com',{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Id: this.state.TextInputId
})
}).then((response) => response.json())
.then((responseJson) => {
Snackbar.show({
title: responseJson,
duration: Snackbar.LENGTH_SHORT,
});
}).catch((error) => {
console.error(error);
})
this.props.navigation.navigate('Home')
Produces the error: Parse error: Unrecognized token '<' React native
<, so XML data (HTML probably). Try to put aconsole.log(response);right beforeresponse.json();