A handler for urllib2 to enable multipart form uploading
Project description
Usage:
Enables the use of multipart/form-data for posting forms
Inspirations:
Upload files in python:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
urllib2_file:
Fabien Seisen: <fabien@seisen.org>
Example:
import MultipartPostHandler, urllib2, cookielib
cookies = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
MultipartPostHandler.MultipartPostHandler)
params = { "username" : "bob", "password" : "riviera",
"file" : open("filename", "rb") }
opener.open("http://wwww.bobsite.com/upload/", params)
Further Example:
The main function of this file is a sample which downloads a page and
then uploads it to the W3C validator.
Enables the use of multipart/form-data for posting forms
Inspirations:
Upload files in python:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306
urllib2_file:
Fabien Seisen: <fabien@seisen.org>
Example:
import MultipartPostHandler, urllib2, cookielib
cookies = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
MultipartPostHandler.MultipartPostHandler)
params = { "username" : "bob", "password" : "riviera",
"file" : open("filename", "rb") }
opener.open("http://wwww.bobsite.com/upload/", params)
Further Example:
The main function of this file is a sample which downloads a page and
then uploads it to the W3C validator.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file MultipartPostHandler-0.1.0.tar.gz
.
File metadata
- Download URL: MultipartPostHandler-0.1.0.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c1823dc586d5507c0d269b763402311868b55236808d033d54300fa73e4a3d |
|
MD5 | e3e51c1b3a72389c0b86ebc96b398365 |
|
BLAKE2b-256 | 1848ba7c00a469cc0a0a7c19deebff844f15779256c209a4992e06e0f511ae36 |
File details
Details for the file MultipartPostHandler-0.1.0-py2.6.egg
.
File metadata
- Download URL: MultipartPostHandler-0.1.0-py2.6.egg
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91bcdf4a93d26bc32f6abc314460ebe66076fd27ab038e299e80c9dbea4534d7 |
|
MD5 | 03b6cc42c45de291287d296c5d37a9b8 |
|
BLAKE2b-256 | df82a070009f869fd31b219a8f13e20552da9a4f150ffed0864ffeb14f65ded0 |