title: TypeError: expected str, bytes or os.PathLike object, not HTTPResponse
body: <p>The purpose of this script is to connect to an API endpoint that provides a .CSV file. I'm not trying to manipulate the data or do anything with the information other than grab it from the endpoint and then save the file to a local directory</p>
  
  <p>I've tested the endpoint and can get a 200 HTTP response from it, but I can not open the file or save it. I continue to get a typeerror response for the last line of the code. </p>
  
  <pre class="lang-py prettyprint-override"><code>import urllib.request as urllib2
  import requests
  from requests.auth import HTTPBasicAuth
  import csv
  
  url = "Https://API_LINK/Details/full_csv"
  request = urllib2.Request(url)
  request.add_header('header_details', 'Token token="token_details"')
  response = urllib2.urlopen(request)
  with open(response,'w', newline='') as f:
  </code></pre>
  
  <p>I expected to be able to define the opened file as 'f', then pass 'f' to csv.reader() and then view rows from the file. What do I do to pass the info as bytes and not as just an httpResponse?</p>