I want to upload a file to google drive using its API, I am using the code
def newer():
url= 'https://USERNAME:[email protected]/upload/drive/v3/files?uploadType=media'
data='''{{
"name":"testing.txt",
}}'''
response = requests.post(url, data=data)
print response.text
However, I am getting response error message as below.
{ "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" } }
Is there some other way to do my job using python.
Should I need to sign in to google cloud to access API for authentication token or credentials