Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch("http://localhost:8001/api/login", {
- method: 'post',
- headers: {
- "Content-type": "application/x-www-form-urlencoded; charset=UTF-8"
- },
- body: 'username=' + this.state.username + '&password=' + this.state.password
- })
- .then(function (responseObject) {
- console.log('Request succeeded with Response object', responseObject);
- })
- .then(function (result){
- console.log(result);
- })
- .catch(function (error) {
- console.log('Request failed', error);
- });
- }else{
- console.log('You must enter username, password.');
- }
Add Comment
Please, Sign In to add comment