Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. try {
  2. let res = await fetch('https://pricesea.ru/api/auth/login', {
  3. method: 'POST',
  4. credentials: 'include',
  5. headers: new Headers({'Accept': 'application/json', 'Content-type': 'application/x-www-form-urlencoded'}),
  6. body: `username=${this.state.username}&password=${this.state.password}`
  7. });
  8.  
  9. if (res.ok) {
  10. ...
  11. }
  12. } catch (e) {
  13. console.log(e);
  14. }
  15.  
  16. TypeError: Network request failed
  17. at XMLHttpRequest.xhr.onerror (fetch.js:441)
  18. at XMLHttpRequest.dispatchEvent (event-target.js:172)
  19. at XMLHttpRequest.setReadyState (XMLHttpRequest.js:546)
  20. at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:381)
  21. at XMLHttpRequest.js:485
  22. at RCTDeviceEventEmitter.emit (EventEmitter.js:181)
  23. at MessageQueue.__callFunction (MessageQueue.js:260)
  24. at MessageQueue.js:101
  25. at MessageQueue.__guard (MessageQueue.js:228)
  26. at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement