mirror of
https://github.com/pvvx/RTL00_WEB.git
synced 2026-07-03 09:55:39 +00:00
first commit
This commit is contained in:
commit
fa343db334
154 changed files with 18186 additions and 0 deletions
30
tools/webfs/py/webfs_upload2.py
Normal file
30
tools/webfs/py/webfs_upload2.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env python3
|
||||
# -*- coding: cp1251 -*-
|
||||
'''
|
||||
test webfs_upload.py
|
||||
Created on 27/09/2015.
|
||||
|
||||
@author: PVV
|
||||
'''
|
||||
#
|
||||
# Use module 'requests' - http://docs.python-requests.org/
|
||||
#
|
||||
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
rtlurl = 'http://rtl871x0/fsupload'
|
||||
username = 'RTL871X'
|
||||
password = '0123456789'
|
||||
filename = '../webbin/WEBFiles.bin'
|
||||
|
||||
files = {'file': (filename, open(filename, 'rb'), 'application/octet-stream')}
|
||||
# postdata = {'':''}
|
||||
# headers = {'Connection' : 'keep-alive'}
|
||||
|
||||
s = requests.Session()
|
||||
# q = s.post(theurl, auth=HTTPBasicAuth(username, password), headers=headers, data=postdata, files=files)
|
||||
q = s.post(rtlurl, auth=HTTPBasicAuth(username, password), files=files)
|
||||
print(q.status_code)
|
||||
Loading…
Add table
Add a link
Reference in a new issue