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:
- Created 7 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 👍
@Amurmurmur Know that is closed but what did you change on server side to make this run?
Thanks for the question itself 😃