Package openid :: Module fetchers
[frames | no frames]

Module openid.fetchers

This module contains the HTTP fetcher interface and several implementations.
Classes
HTTPFetcher This class is the interface for openid HTTP fetchers.
HTTPResponse XXX document attributes

Exceptions
HTTPError This exception is raised by the CurlHTTPFetcher when it encounters an exceptional situation fetching a URL.
HTTPFetchingError Exception that is wrapped around all exceptions that are raised by the underlying fetcher when using the ExceptionWrappingFetcher

Function Summary
  createHTTPFetcher()
Create a default HTTP fetcher instance
  fetch(url, body, headers)
Invoke the fetch method on the default fetcher.
HTTPFetcher getDefaultFetcher()
Return the default fetcher instance if no fetcher has been set, it will create a default fetcher.
  setDefaultFetcher(fetcher, wrap_exceptions)
Set the default fetcher

Function Details

createHTTPFetcher()

Create a default HTTP fetcher instance

prefers Curl to urllib2.

fetch(url, body=None, headers=None)

Invoke the fetch method on the default fetcher. Most users should need only this method.
Raises:
Exception - any exceptions that may be raised by the default fetcher

getDefaultFetcher()

Return the default fetcher instance if no fetcher has been set, it will create a default fetcher.
Returns:
the default fetcher
           (type=HTTPFetcher)

setDefaultFetcher(fetcher, wrap_exceptions=True)

Set the default fetcher
Parameters:
fetcher - The fetcher to use as the default HTTP fetcher
           (type=HTTPFetcher)
wrap_exceptions - Whether to wrap exceptions thrown by the fetcher wil HTTPFetchingError so that they may be caught easier. By default, exceptions will be wrapped. In general, unwrapped fetchers are useful for debugging of fetching errors or if your fetcher raises well-known exceptions that you would like to catch.
           (type=bool)

Generated by Epydoc 2.1 on Wed Apr 22 16:14:21 2009 http://epydoc.sf.net