Python: How to POST a .bin file -


i trying write python program http post file in order upgrade dd wrt router's firmware.

i can't believe how difficult has been.

i have tried library after library: requests, urllib, mechanize, poster, etc

all want submit form 1 input (erase=0) , ddwrt-upgrade-file.bin!

also, basic auth required.

can me out here

here capture fiddler of working post submitted myself using chrome:

------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="submit_button"      upgrade     ------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="action"       ------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="change_action"       ------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="submit_type"       ------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="erase"      0     ------webkitformboundaryhunea7lutbbt3jfn     content-disposition: form-data; name="file"; filename="dd-wrt-webupgrade_public_vga.bin"     content-type: application/octet-stream 


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -