How do I make a GET request for cloudinary resources?
Greetings!
I'm trying to make a fetch request from within a React component on the front end of my application in order to render a list of all the resources ( or any of the resources ) in my cloudinary account. I have an API key and secret that I was using in the url, which I passed as the argument to my fetch function.
Here's the error the console logs:
"TypeError: Failed to execute 'fetch' on 'Window': Request cannot be constructed from a URL that includes credentials: https://<<API KEY>>:<<API SECRET>>@api.cloudinary.com/v1_1/<<RESOURCE NAME>>/resources/image"
When I hit the url from the browser, I get the JSON I want. How can I retreive those resources from within my React component?
Thanks a million in advance.
codbase can be found here: https://github.com/PantherHawk/prints20-2018
-
Hi Alex,
Try setting the credentials in the header.
Here are few links which can help:-
https://stackoverflow.com/questions/45067331/request-with-url-that-includes-credentials
https://github.com/avadev/AvaTax-REST-V2-JS-SDK/issues/41
Let me know how it goes.
Thanks,
Aditi
Post is closed for comments.
Comments
1 comment