GNU Info

Info Node: (python2.1-lib.info)Request Objects

(python2.1-lib.info)Request Objects


Next: OpenerDirector Objects Prev: urllib2 Up: urllib2
Enter node , (file) or (file)node

Request Objects
---------------

The following methods describe all of `Request''s public interface, and
so all must be overridden in subclasses.

`add_data(data)'
     Set the `Request' data to DATA is ignored by all handlers except
     HTTP handlers -- and there it should be an
     `application/x-www-form-encoded' buffer, and will change the
     request to be `POST' rather then `GET'.

`has_data(data)'
     Return whether the instance has a non-`None' data.

`get_data(data)'
     Return the instance's data.

`add_header(key, val)'
     Add another header to the request.  Headers are currently ignored
     by all handlers except HTTP handlers, where they are added to the
     list of headers sent to the server.  Note that there cannot be
     more then one header with the same name, and later calls will
     overwrite previous calls in case the KEY collides.  Currently,
     this is no loss of HTTP functionality, since all headers which
     have meaning when used more then once have a (header-specific) way
     of gaining the same functionality using only one header.

`get_full_url()'
     Return the URL given in the constructor.

`get_type()'
     Return the type of the URL -- also known as the scheme.

`get_host()'
     Return the host to which connection will be made.

`get_selector()'
     Return the selector -- the part of the URL that is sent to the
     server.

`set_proxy(host, type)'
     Make the request by connecting to a proxy server. The HOST and
     TYPE will replace those of the instance, and the instance's
     selector will be the original URL given in the constructor.


automatically generated by info2www version 1.2.2.9