Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kdm9/multiparthandler
Updated version of MultipartPostHandler
https://github.com/kdm9/multiparthandler
Last synced: 11 days ago
JSON representation
Updated version of MultipartPostHandler
- Host: GitHub
- URL: https://github.com/kdm9/multiparthandler
- Owner: kdm9
- Created: 2013-01-05T00:06:36.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-07-13T08:05:26.000Z (over 11 years ago)
- Last Synced: 2024-10-11T19:23:05.150Z (about 1 month ago)
- Language: Python
- Size: 207 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
multiparthandler:
A module to allow urllib2 to POST to multipart/form-data forms.
This is an updated version of MultipartPostHandler, by Will Holcomb.
The original module has been modernized, and made compatible with Python 3.x.License:
Copyright (c) 2012 Kevin Murray [email protected]multiparthandler is licensed under the LGPL v3
See for full license text.NOTE: This is not an official updated version of MultipartPostHandler,
and is not affiliated with the original author in any way.Example Usage:
(Adapted from MultipartPostHandler's example)
>>>import multiparthandler
>>>import urllib2
>>>import cookielib
>>>cookies = cookielib.CookieJar()
>>>opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
... multiparthandler.multiparthandler)
>>>params = { "username" : "bob", "password" : "riviera",
... "file" : open("filename", "rb") }
>>>opener.open("http://wwww.bobsite.com/upload/", params)Further Examples can be found in the unittests provided in the ```tests/``
directory.