title: How do I upload file to google drive using drive API using python?
body: <p>I want to upload a file to google drive using its API, I am using the code</p>
  
  <pre><code>def newer():
      url= 'https://USERNAME:PASSWORD@www.googleapis.com/upload/drive/v3/files?uploadType=media'
      data='''{{
        "name":"testing.txt",
      }}'''
      response = requests.post(url, data=data)
      print response.text
  </code></pre>
  
  <p>However, I am getting response error message as below.</p>
  
  <blockquote>
    <p>{  "error": {   "errors": [    {
        "domain": "global",
        "reason": "authError",
        "message": "HTTP Basic Authentication is not supported for this API",
        "locationType": "header",
        "location": "Authorization"    }   ],   "code": 401,   "message": "HTTP Basic Authentication is not supported for this API"  } }</p>
  </blockquote>
  
  <p>Is there some other way to do my job using python.</p>
  
  <p>Should I need to sign in to google cloud to access API for authentication token or credentials</p>