Onyx
Onyx

Reputation: 5772

All requests to a Places service must use the https:// protocol, and include an API key

Whenever I make an axios GET request to Google's Places API, I get an error:

"has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is 
present on the requested resource."

I checked the documentation of Google's Place API and found this:

"Each of the services is accessed as an HTTP request, and returns either an JSON or 
XML response. All requests to a Places service must use the https:// protocol, and 
include an API key."

Am I understanding correctly that in order for me to use that API, the request must come from a hosted website with domain name and SSL certificate so that I can have a https:// protocol?

I'm currently working on http://localhost:8080/#/. Is there a way for me to use this API so I can develop my app without using hosting at this point?

Upvotes: 0

Views: 122

Answers (1)

Jaromanda X
Jaromanda X

Reputation: 1

What that documentation is saying is

all requests must use https and must include an API key

the CORS thing suggests,

requests must come from a server, not a browser,

That doesn't mean the server has to be a https server, it just has to make requests for that API using HTTPS

Upvotes: 1

Related Questions