Need Help Fetching Data with ReactJS

Hi all,

I am trying to hydrate my app with musicbrainz DB as a json file. When checking the console I get an error “You are not authorized to access this resource.”

How do I gain access? How do I make a user agent header with fetch API in React?

useEffect(() => {

.then(response => response.json())
.then(myJson => {

}, [])

Your call requests User-Genres, which are the genres the currently logged in user has set themselves. That means in order for this call to succeed the user needs to login, which would require you to implement oauth authentication.

But probably that’s not what you want, in this case don’t include the User-Genres inc parameter.