A handler for urllib2 to enable multipart form uploading
Project description
Usage:
Enables the use of multipart/form-data for posting forms
add a fix for utf-8 systems.
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
opener = urllib2.build_opener(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
add a fix for utf-8 systems.
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
opener = urllib2.build_opener(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
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 MultipartPostHandler2-0.1.3.tar.gz
.
File metadata
- Download URL: MultipartPostHandler2-0.1.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57d5e7da1884c3fa00e811ac2a8f2e5cf186434948adc9df49cf5c4479b2ef27 |
|
MD5 | e8103c32edad3384fd18c28e12ff42a5 |
|
BLAKE2b-256 | 6412ab9a9027680d197ec240ac222140c4f8318779773c871cd8f99bfe43fd1b |
File details
Details for the file MultipartPostHandler2-0.1.3-py2.7.egg
.
File metadata
- Download URL: MultipartPostHandler2-0.1.3-py2.7.egg
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d14bbae43491fb202715412d802b2b44b484ed7b0799a8acc9df6a9fcbf7983 |
|
MD5 | ba3250df3649c9c1a09771e998e9b7f0 |
|
BLAKE2b-256 | e03f0c32e76b84bb20b2c53ec3f7c7f7a619b28fb6b1f3ffb272ecf92903bb1f |