MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / _get_body

Method _get_body

googlemaps/client.py:355–370  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

353 return self._request(*args, **kwargs)
354
355 def _get_body(self, response):
356 if response.status_code != 200:
357 raise googlemaps.exceptions.HTTPError(response.status_code)
358
359 body = response.json()
360
361 api_status = body["status"]
362 if api_status == "OK" or api_status == "ZERO_RESULTS":
363 return body
364
365 if api_status == "OVER_QUERY_LIMIT":
366 raise googlemaps.exceptions._OverQueryLimit(
367 api_status, body.get("error_message"))
368
369 raise googlemaps.exceptions.ApiError(api_status,
370 body.get("error_message"))
371
372 def _generate_auth_url(self, path, params, accepts_clientid):
373 """Returns the path and query string portion of the request URL, first

Callers 1

_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected