Created
February 19, 2021 13:20
-
-
Save evan-boissonnot/6f132f54fbd55fc487f9b05c38f2df66 to your computer and use it in GitHub Desktop.
fetch to our web api dotnet core
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
</head> | |
<body> | |
<h1>Test api</h1> | |
<script> | |
var myHeaders = new Headers(); | |
myHeaders.append("Content-Type", "application/json"); | |
var myInit = { | |
method: 'GET', | |
headers: myHeaders | |
} | |
fetch('https://localhost:44357/api/v1/selfies', myInit) | |
.then(result => result.json()) | |
.then(selfies => { | |
console.info(selfies); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment