Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. var uploadReq = new Request(LOGIN_URL, {
  2. method: 'post',
  3. headers: new Headers({
  4. 'Content-Type': 'application/json',
  5. }),
  6. body: JSON.stringify({
  7. username: this.state.username,
  8. password: this.state.password
  9. })
  10.  
  11. });
  12.  
  13. fetch(uploadReq)
  14. .then(this._requestHandler)
  15. .catch(function (err) {
  16. console.log('Fetch Error :-S', err);
  17. });
  18.  
  19. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement