Available hooks:
-``args``:
- A dictionary of the arguments being sent to Request().
-
``pre_request``:
The Request object, directly after being created.
"""
-HOOKS = ('args', 'pre_request', 'pre_send', 'post_request', 'response')
-
+HOOKS = ('pre_prepare', 'post_prepare', 'pre_request', 'pre_send', 'post_request', 'response')
+# TODO: response is the only one
def dispatch_hook(key, hooks, hook_data):
"""Dispatches a hook dictionary on a given piece of data."""
This module contains the primary objects that power Requests.
"""
-import os
-import socket
-import collections
+# import os
+# import socket
+# import collections
import logging
-from datetime import datetime
+# from datetime import datetime
from io import BytesIO
from .hooks import dispatch_hook, HOOKS
from .auth import HTTPBasicAuth, HTTPProxyAuth
from .cookies import cookiejar_from_dict, extract_cookies_to_jar, get_cookie_header
-from .packages.urllib3.exceptions import MaxRetryError, LocationParseError
-from .packages.urllib3.exceptions import TimeoutError
-from .packages.urllib3.exceptions import SSLError as _SSLError
-from .packages.urllib3.exceptions import HTTPError as _HTTPError
-from .packages.urllib3 import connectionpool, poolmanager
+# from .packages.urllib3.exceptions import MaxRetryError, LocationParseError
+# from .packages.urllib3.exceptions import TimeoutError
+# from .packages.urllib3.exceptions import SSLError as _SSLError
+# from .packages.urllib3.exceptions import HTTPError as _HTTPError
+# from .packages.urllib3 import connectionpool, poolmanager
from .packages.urllib3.filepost import encode_multipart_formdata
from .exceptions import (