HTTPS status

4 posts / 0 new
Last post
jasond
HTTPS status

Today I received an email stating that TLS 1.0 and 1.1 are being discontinued. What is the status of HTTP support? Is it also being discontinued? We currently use the Directions and Static Map API. The documentation for directions uses HTTP but Static Map uses HTTPS. I currently use only HTTP in our code. I don't think HTTPS support existed or was not documented when we joined MQ.


MQBrianCoakley
There is no change to http.
There is no change to http. That will keep truckin along as expected.   The https support has been there for several years - at least as long as the restful apis have existed. It may not have been pointed out specifically in the docs but it has been around.   Keep in mind that this change is only for open.mapquestapi.com. This is not the case for www.mapquestapi.com.

hanhnguyen
HTTP Error 400: Bad request

I got the following errors when executed the code below. Any idea how to fix this problem?

Thanks!

...

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad request
Hanhs-MacBook-Pro:project3 hanhnguyen$

import urllib.request
import json

class maps:
def __init__(self,key):
self.key = key

def open_url(self,url : str) -> 'json':
req = urllib.request.Request(url, headers={'content-type': 'application/json'})
response = urllib.request.urlopen(req)
ret_text = response.read.decode(encoding = 'utf-8')
return json.loads(ret_text)

c = maps('key')
c.open_url('http://www.mapquestapi.com/directions/v2/route?key=XYZ&from=Clarendon Blvd,Arlington,VA&to=2400+S+Glebe+Rd,+Arlington,+VA')


MQBrianCoakley
If you encode the to and from
If you encode the to and from parameters does it work any differently?