mementoweb.validator.util package

Submodules

mementoweb.validator.util.http module

class mementoweb.validator.util.http.HttpConnection(host, scheme, uri)

Bases: object

An adapter class for HTTPConnection. Used for isolating urlib incase of issues in the future.

get_response() mementoweb.validator.util.http.HttpResponse
request(method, path, headers)
class mementoweb.validator.util.http.HttpResponse(response: Optional[http.client.HTTPResponse] = None, uri='')

Bases: object

An adapter class for isolating urlib incase of future changes/ issues. Encapsulates HTTP response from an established connection.

body = None
get_body()
get_headers(name: str) str
header_keys() List
parse_body()
status = None
mementoweb.validator.util.http.http(uri: str, datetime='Thu, 10 Oct 2009 12:00:00 GMT', accept='text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', accept_language='en-us,en;q=0.5', proxy_connection='keep-alive', user_agent='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2', method='HEAD') mementoweb.validator.util.http.HttpConnection

Initiates HTTP connections using the given parameters using the HTTP Adapter.

Parameters
  • uri – URI for the connection

  • datetime – Datetime for Accept-Datetime header

  • accept – Content type for Accept header

  • accept_language – language for Accept-Language head

  • proxy_connection – value for Proxy-Connection header

  • user_agent – User-Agent header

:param method:request method. Defaults to HEAD. :return: HTTP connection using the given parameters.

Module contents