API client: Enforce https

This commit is contained in:
Théophile Bastian 2017-10-16 21:23:10 +02:00
parent 2264b0886f
commit 32716892d7

View file

@ -15,7 +15,7 @@ import sys
def sendReq(url): def sendReq(url):
def send(payload, host): def send(payload, host):
try: try:
req = urllib.request.Request('http://{}/{}'.format(host, url), req = urllib.request.Request('https://{}/{}'.format(host, url),
json.dumps(payload).encode('ascii')) json.dumps(payload).encode('ascii'))
req.add_header('Content-Type', 'application/json') req.add_header('Content-Type', 'application/json')
handle = urllib.request.urlopen(req) handle = urllib.request.urlopen(req)