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

Class HTTPFetcher

source code

object --+
         |
        HTTPFetcher
Known Subclasses:

This class is the interface for openid HTTP fetchers. This interface is only important if you need to write a new fetcher for some reason.

Instance Methods
HTTPResponse
fetch(self, url, body=None, headers=None)
This performs an HTTP POST or GET, following redirects along the way.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

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

source code 

This performs an HTTP POST or GET, following redirects along the way. If a body is specified, then the request will be a POST. Otherwise, it will be a GET.

Parameters:
  • headers ({str:str}) - HTTP headers to include with the request
Returns: HTTPResponse
An object representing the server's HTTP response. If there are network or protocol errors, an exception will be raised. HTTP error responses, like 404 or 500, do not cause exceptions.
Raises:
  • Exception - Different implementations will raise different errors based on the underlying HTTP library.