Browse Source

publish muk_utils - 11.0

pull/6/head
MuK IT GmbH 6 years ago
parent
commit
98170719e6
  1. 6
      muk_utils/tools/http.py

6
muk_utils/tools/http.py

@ -55,19 +55,19 @@ def get_response(url):
session = requests.Session() session = requests.Session()
session.cookies['session_id'] = request.session.sid session.cookies['session_id'] = request.session.sid
try: try:
response = session.get("%s%s" % (base_url, path), params, verify=False)
response = session.post("%s%s" % (base_url, path), params=params, verify=False)
return response.status_code, response.headers, response.content return response.status_code, response.headers, response.content
except Exception as exception: except Exception as exception:
_logger.info("Trying custom certificate") _logger.info("Trying custom certificate")
custom_cert = config.get("muk_custom_certificate", False) custom_cert = config.get("muk_custom_certificate", False)
try: try:
_logger.info("Using Certificate: {}".format(custom_cert)) _logger.info("Using Certificate: {}".format(custom_cert))
response = session.post("%s%s" % (base_url, path), params, verify=custom_cert)
response = session.post("%s%s" % (base_url, path), params=params, verify=custom_cert)
return response.status_code, response.headers, response.reason return response.status_code, response.headers, response.reason
except Exception as e: except Exception as e:
try: try:
_logger.info("Custom Certificate didn't work") _logger.info("Custom Certificate didn't work")
response = session.post("%s%s" % (base_url, path), params, verify=False)
response = session.post("%s%s" % (base_url, path), params=params, verify=False)
return response.status_code, response.headers, response.reason return response.status_code, response.headers, response.reason
except Exception as e: except Exception as e:
_logger.exception("Request failed!") _logger.exception("Request failed!")

Loading…
Cancel
Save