title: Python how to make a curl request with username/password
body: <p>Trying to hit an api which returns a json. Documentation says to hit it in this fashion: </p>
  
  <p>curl --user username:password "<a href="https://api.company.com/dummyapi.json" rel="noreferrer">https://api.company.com/dummyapi.json</a>"</p>
  
  <p>Works like a champ from the command line and in PHP. I'm new to Python. How do I do mimic this in Python? I've tried requests and subprocess.call but I keep getting a bad request response from the server saying that credentials were not provided. </p>