in app.py [0:0]
def time():
"""Example call to the time estimates endpoint.
Returns the time estimates from the given lat/lng given below.
"""
url = config.get('base_uber_url') + 'estimates/time'
params = {
'start_latitude': config.get('start_latitude'),
'start_longitude': config.get('start_longitude'),
}
response = app.requests_session.get(
url,
headers=generate_ride_headers(session.get('access_token')),
params=params,
)
if response.status_code != 200:
return 'There was an error', response.status_code
return render_template(
'results.html',
endpoint='time',
data=response.text,
)