Created
July 23, 2020 20:19
-
-
Save metabsd/402fe1b2a39849ec9f94539e11e4f332 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urlparse() | |
ParseResult(scheme='https', netloc='localhost:4343', path='/services/v1/org/ee6202f2-a3be-44c5-b4bb-a7c251e92b1e/inlg', params='', query='&p=0&s=1&q=___displayName%25%22bbm_crmmap_ntz%22', fragment='') | |
Faire la connection https et tentative de faire un GET mais j'ai un query string. | |
conn = httplib.HTTPSConnection( | |
url_info.netloc, context=context, timeout=10, | |
) | |
conn.request("GET", url_info.path + url_info.query, headers=headers) | |
response = conn.getresponse() | |
try: | |
if 400 <= response.status < 500: | |
raise AnsibleError( | |
f"Status: {response.status} Reason: {response.reason} Data: {response.read()}" | |
) | |
elif 500 <= response.status < 600: | |
raise AnsibleError( | |
f"Status: {response.status} Reason: {response.reason} Data: {response.read()}" | |
) | |
else: | |
data = response.read().decode("utf-8") | |
return json.loads(data) | |
ERREUR : | |
Data: b'{\"timestamp\":\"2020-07-23T20:13:31.407+0000\",\"status\":500,\"error\":\"Internal Server Error\",\"message\":\"The request was rejected because the URL contained a potentially malicious String \\\\\"%25\\\\\"\",\"path\":\"/services/v1/org/ee6202f2-a3be-44c5-b4bb-a7c251e92b1e/inlg&p=0&s=1&q=___displayName%25%22bbm_crmmap_ntz%22\"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment