Created
February 18, 2019 23:19
-
-
Save bennycode/ed95ed9edd6ce0d04e7c8d6e6eb1a1f8 to your computer and use it in GitHub Desktop.
Send POST request in Google Chrome
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
// Using "var" here to easily change the parameters and resubmit the code in a JS dev console! | |
var url = 'http://127.0.0.1:3000/login'; | |
var parameters = { | |
user: 'bennyn', | |
password: 'secret' | |
}; | |
fetch(url, { | |
method: 'post', | |
body: JSON.stringify(parameters) | |
}) | |
.then((response) => response.json()) | |
.then(console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment