Networking
Implementation of XMLHttpRequestAPI means axios works!
Also [Fetch API]
iOS requires https unless you add an expection
Cookie authentication is currently unstable
fetch('https://mywebsite.com/mydata.json');
fetch('https://mywebsite.com/endpoint/', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstParam: 'yourValue',
secondParam: 'yourOtherValue',
}),
});
async function getMoviesFromApi() {
try {
let response = await fetch(
'https://facebook.github.io/react-native/movies.json',
);
let responseJson = await response.json();
return responseJson.movies;
} catch (error) {
console.error(error);
}
}Websockets
Full-deplex communication channels over a single TCP connection
Last updated