googlemaps / googlemaps/google-maps-services-js

GeoCode: request error over geocode API

Open
#1,025 3 comments 2 reactions 0 assignees View on GitHub
needs more info
Dominant language
TypeScript
Stars
3.1k
Forks
654
Avg merge
3m
Merged PRs (30d)
4

Description

#### Environment details

1. Specify the API: GeoCode
2. OS type and version: MacOS Ventura
3. Library version and other environment information: 3.3.36

#### Steps to reproduce

1. Run the code below in bash with Node.js 14.3.0

#### Code example

```TypeScript
try {
const result = await client.geocode({
params: {
key: 'my_key',
address: 'Log Angeles, CA',
},
});
console.log(result);
} catch (e: any) {
console.log(e.response.data.error_message);
}
```

This is quite simple demo to get geocode of an address using GeoCode API. The key is set and there is no any restrictions over the key.

But I got `Requests to this API must be over SSL. Load the API with "https://" instead of "http://".` and HTTP status code 403 as error message for the request. Is there any other configs or options to enable HTTPS or should I specify the endpoint manually? I can not find solution or documentation about this.

Thanks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.