1
0
mirror of https://github.com/gsi-upm/sitc synced 2025-12-15 09:38:16 +00:00

Minor changes LOD 01 and 03

This commit is contained in:
J. Fernando Sánchez
2022-02-15 20:48:49 +01:00
parent 95cd25aef4
commit 66ed4ba258
4 changed files with 112 additions and 74 deletions

View File

@@ -12,6 +12,7 @@ from urllib.request import Request, urlopen
from urllib.parse import quote_plus, urlencode
from urllib.error import HTTPError
import ssl
import json
import sys
@@ -32,7 +33,11 @@ def send_query(query, endpoint):
headers={'content-type': 'application/x-www-form-urlencoded',
'accept': FORMATS},
method='POST')
res = urlopen(r)
context = ssl.create_default_context()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
res = urlopen(r, context=context)
data = res.read().decode('utf-8')
if res.getcode() == 200:
try: