Created
December 15, 2019 21:15
-
-
Save PadreSVK/6df6da97d78008df9ae5e2c7a9fe4b8d to your computer and use it in GitHub Desktop.
Get data from server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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