https://facebook.github.io/react-native/docs/network.html
ой код:
componentWillMount() {
fetch("http://10.4.5.114/localservice/webservice/rest/server.php", {
method: 'POST',
body: JSON.stringify({
wstoken: 'any_token',
wsfunction: 'any_function',
moodlewsrestformat: 'json',
username: 'user',
password: 'pass',
})
})
.then((response) => response.text())
.then((responseText) => {
alert(responseText);
})
.catch((error) => {
console.error(error);
});
}
В браузере этот запрос возвращает токен, но в моем приложении Android-native-android возвращается ошибка XML.