protocol.http.util Module

Miscellaneous HTTP functions.

wpull.protocol.http.util.parse_charset(header_string)[source]

Parse a “Content-Type” string for the document encoding.

Returns:str, None
wpull.protocol.http.util.should_close(http_version, connection_field)[source]

Return whether the connection should be closed.

Parameters:
  • http_version (str) – The HTTP version string like HTTP/1.0.
  • connection_field (str) – The value for the Connection header.