Skip to content

Commit

Permalink
working with data having file and payload info of device.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdev2 committed Oct 15, 2020
1 parent 490a5f0 commit 909564c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions floor_flasher/flashfloor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ async def fetch(url, session):
return (response_status,response_text)

async def post_firmware(url, session, firmwarepath):
payload = {'device': 0}
async with session.post(url, data=payload, files={'file': open(firmwarepath, 'rb')}) as response:
payload = {
'device': "0",
'file': open(firmwarepath, 'rb')
}
async with session.post(url, data=payload) as response:
response_text = await response.text()
response_status = response.status
return (response_status,response_text)
Expand Down

0 comments on commit 909564c

Please sign in to comment.