Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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.

Project details


Release history Release notifications

This version

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for MultipartPostHandler, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size MultipartPostHandler-0.1.0-py2.6.egg (8.0 kB) File type Egg Python version 2.6 Upload date Hashes View hashes
Filename, size MultipartPostHandler-0.1.0.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page