Get request with auth

    0

    22

    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
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.