Skip to content

Instantly share code, notes, and snippets.

@adityaarakeri
Forked from random-robbie/requests.py
Created June 26, 2019 07:06
Show Gist options
  • Save adityaarakeri/2b7cea0e5476f8c279e7fa9ae373c8a8 to your computer and use it in GitHub Desktop.
Save adityaarakeri/2b7cea0e5476f8c279e7fa9ae373c8a8 to your computer and use it in GitHub Desktop.

Revisions

  1. @random-robbie random-robbie revised this gist Mar 22, 2018. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion requests.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,9 @@
    import requests
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)

    URL = "https://www.somesitewithbadssl.com"
    headers = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0","Connection":"close","Accept-Language":"en-US,en;q=0.5","Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","Upgrade-Insecure-Requests":"1"}
    response = session.get(URL, headers=headers, timeout=15, verify=False)
    result = response.text
    print (result)
  2. @random-robbie random-robbie created this gist Mar 22, 2018.
    3 changes: 3 additions & 0 deletions requests.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    import requests
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)