Skip to content

Instantly share code, notes, and snippets.

@PadreSVK

PadreSVK/script.js

Created Dec 15, 2019
Embed
What would you like to do?
Get data from server
document.cookie
const response = await fetch('https://localhost:5001/weather/GetAllCities', {method: "POST"});
const myJson = await response.json();
console.log(JSON.stringify(myJson));
fetch('https://localhost:5001/weather', {method: "POST"})
.then(response => response.json())
.then(json=> console.log(JSON.stringify(json)))
const xhr = new XMLHttpRequest();
xhr.open('POST', 'https://localhost:5001/weather/GetAllCities', true);
xhr.withCredentials = true;
xhr.send();
xhr.response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.