This commit is contained in:
tmshv committed 2018-11-28 18:37:16 +03:00
1 parent ef3fa2b0c7
commit 1ce449320c
75 files changed
+103953 -1264

No files matched your search

+12 -3
View File
@@ -39,6 +39,15 @@ async def post(url, data, params={}, headers={}):
async def put(url, data):
async with aiohttp.ClientSession as session:
res = session.put(url, data=data)
return await res.text()
# login, password = settings.upload_auth
login, password = ('uploader', '207690962638465')
auth = aiohttp.BasicAuth(login, password, encoding='utf-8')
async with aiohttp.request('put', url=url, data=data, auth=auth) as resp:
print(resp.status)
print(await resp.text())
# async with aiohttp.ClientSession(auth=auth) as session:
# res = session.put(url, data=data)
# return await res.text()