main
Bob Mottram 2023-10-11 21:17:41 +01:00
parent 0a90c3f077
commit f29621d8c1
1 changed files with 10 additions and 10 deletions

View File

@ -96,9 +96,9 @@ def url_exists(session, url: str, timeout_sec: int = 3,
return False return False
def _get_json_request(session, url: str, domain_full: str, session_headers: {}, def _get_json_request(session, url: str, session_headers: {},
session_params: {}, timeout_sec: int, session_params: {}, timeout_sec: int,
signing_priv_key_pem: str, quiet: bool, debug: bool, quiet: bool, debug: bool,
return_json: bool) -> {}: return_json: bool) -> {}:
"""http GET for json """http GET for json
""" """
@ -242,8 +242,8 @@ def _get_json_signed(session, url: str, domain_full: str, session_headers: {},
return_json = True return_json = True
if 'json' not in content_type: if 'json' not in content_type:
return_json = False return_json = False
return _get_json_request(session, url, domain_full, session_headers, return _get_json_request(session, url, session_headers,
session_params, timeout_sec, None, quiet, session_params, timeout_sec, quiet,
debug, return_json) debug, return_json)
@ -292,9 +292,9 @@ def get_json(signing_priv_key_pem: str,
session_headers, session_params, session_headers, session_params,
timeout_sec, signing_priv_key_pem, timeout_sec, signing_priv_key_pem,
quiet, debug) quiet, debug)
return _get_json_request(session, url, domain, session_headers, return _get_json_request(session, url, session_headers,
session_params, timeout_sec, session_params, timeout_sec,
None, quiet, debug, True) quiet, debug, True)
def get_vcard(xml_format: bool, def get_vcard(xml_format: bool,
@ -413,9 +413,9 @@ def download_html(signing_priv_key_pem: str,
session_headers, session_params, session_headers, session_params,
timeout_sec, signing_priv_key_pem, timeout_sec, signing_priv_key_pem,
quiet, debug) quiet, debug)
return _get_json_request(session, url, domain, session_headers, return _get_json_request(session, url, session_headers,
session_params, timeout_sec, session_params, timeout_sec,
None, quiet, debug, False) quiet, debug, False)
def verify_html(session, url: str, debug: bool, def verify_html(session, url: str, debug: bool,
@ -550,9 +550,9 @@ def download_ssml(signing_priv_key_pem: str,
session_headers, session_params, session_headers, session_params,
timeout_sec, signing_priv_key_pem, timeout_sec, signing_priv_key_pem,
quiet, debug) quiet, debug)
return _get_json_request(session, url, domain, session_headers, return _get_json_request(session, url, session_headers,
session_params, timeout_sec, session_params, timeout_sec,
None, quiet, debug, False) quiet, debug, False)
def _set_user_agent(session, http_prefix: str, domain_full: str) -> None: def _set_user_agent(session, http_prefix: str, domain_full: str) -> None: