Get request with auth

    0

    33

    Python public recipes

    Shortcut: requests.get.basic-auth

    import requests
    from requests.auth import HTTPBasicAuth
    
    response = requests.get(url, auth = HTTPBasicAuth(username, password))
    if reponse.status_code == 200:
      response_text = response.text
      response_json = response.json()
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.