Logo Search packages:      
Sourcecode: nautilus-image-manipulator version File versions  Download package

Classes | Functions | Variables

nautilus_image_manipulator::upload::poster::streaminghttp Namespace Reference


class  _StreamingHTTPMixin
class  StreamingHTTPConnection
class  StreamingHTTPHandler
class  StreamingHTTPRedirectHandler
class  StreamingHTTPSConnection
class  StreamingHTTPSHandler


def get_handlers
def register_openers


list __all__

Detailed Description

Streaming HTTP uploads module.

This module extends the standard httplib and urllib2 objects so that
iterable objects can be used in the body of HTTP requests.

In most cases all one should have to do is call :func:`register_openers()`
to register the new streaming http handlers which will take priority over
the default handlers, and then you can use iterable objects in the body
of HTTP requests.

**N.B.** You must specify a Content-Length header if using an iterable object
since there is no way to determine in advance the total size that will be
yielded, and there is no way to reset an interator.

Example usage:

>>> from StringIO import StringIO
>>> import urllib2, poster.streaminghttp

>>> opener = poster.streaminghttp.register_openers()

>>> s = "Test file data"
>>> f = StringIO(s)

>>> req = urllib2.Request("http://localhost:5000", f,
...                       {'Content-Length': str(len(s))})

Generated by  Doxygen 1.6.0   Back to index