Advertisement
Guest User

Untitled

a guest
Aug 13th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. handleSubmit = event => {
  2. event.preventDefault();
  3. axios({
  4. method: 'post',
  5. url: API,
  6. data: {
  7. user: this.state.user,
  8. password: this.state.password
  9. },
  10. withCredentials: false,
  11. responseType: 'json',
  12. responseEncoding: 'utf8'
  13. }).then(response => {
  14.  
  15.  
  16. if (response.statusText == "OK") {
  17. console.log('RESPONSE STATUS OK');
  18.  
  19. user: response.data.user
  20. password: response.data.password
  21.  
  22. console.log("Password" + this.state.password);
  23. console.log("User:" + this.state.user);
  24.  
  25. } else {
  26. console.log("Return to login");
  27. }
  28. });
  29.  
  30. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement