pyguymer3.download_header

pyguymer3.download_header(sess, url, /, *, cookies=None, headers=None, timeout=10.0, verify=True)[source]

HEAD a URL and return the headers

This function performs a HTTP HEAD operation on a URL and returns the headers.

Parameters:
  • sess (requests.sessions.Session) – the requests session to use

  • url (str) – the URL

  • cookies (dict, optional) – the cookie jar

  • headers (dict, optional) – extra headers to send

  • timeout (float, optional) – the timeout of the HEAD request

  • verify (bool, optional) – verify the server’s certificates

Returns:

respFalse if unsuccessful or a dict if successful

Return type:

bool, bytes

Notes

Copyright 2017 Thomas Guymer [1]

References