Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Write a Basic Fetch Request

Stephen Falck
Stephen Falck
7,558 Points

using a fetch request in my own project and receiving error message

im getting this:

Access to fetch at 'http://0.0.0.0:5000/api/v1/BlogPostView' from origin 'null' has been blocked by CORS policy: 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 fetch the resource with CORS disabled.

followed by:

Uncaught (in promise) TypeError: Failed to fetch

how can i solve this problem?

Stephen Falck
Stephen Falck
7,558 Points

great that has made it work, thanks!

1 Answer