question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set mode: no-cors

See original GitHub issue

@skellock How can I set the mode to no-cors?

In fetch I would do it this way:

fetch('https://github.com/', {
    method: 'get',
    headers: {
        'Accept': 'application/json, text/plain, */*',
        'Content-Type': 'application/json'
    },
    mode: 'no-cors',
}))

How can I achieve similar thing with axios/apisauce

Thank you in advance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Amurmurmurcommented, Mar 8, 2017

@skellock I’ve used apisauce with the react-native, and currently using it with the browser too(Chrome more specifically).

With react-native apisauce works like a charm, I can only say it is so amazing and comfortable and declarative 👍

0reactions
markusguenthercommented, Jun 12, 2019

@Amurmurmur Know that is closed but what did you change on server side to make this run?

Thanks for the question itself 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Trying to use fetch and pass in mode: no-cors - Stack Overflow
That's because what setting mode: 'no-cors' actually says to the browser is, “Block my frontend JavaScript code from looking into the ...
Read more >
Request.mode - Web APIs - MDN Web Docs
Value · same-origin. If a request is made to another origin with this mode set, the result is an error. · no-cors. Prevents...
Read more >
set the request's mode to 'no-cors' to fetch the ... - You.com
No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to ......
Read more >
Common no-cors misconceptions - Evert Pot
What is no-cors ? · Any request header except: Accept , Accept-Language , Content-Language , Content-Type will be silently stripped from the ...
Read more >
Fixing Common Problems with CORS and JavaScript
It suggests two solutions. The second suggestion is to change the mode from cors to no-cors in the JavaScript fetch request. This is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found