MCPcopy
hub / github.com/psf/requests / prepare_hooks

Method prepare_hooks

src/requests/models.py:720–727  ·  view source on GitHub ↗

Prepares the given hooks.

(self, hooks: _t.HooksInputType | None)

Source from the content-addressed store, hash-verified

718 self.headers["Cookie"] = cookie_header
719
720 def prepare_hooks(self, hooks: _t.HooksInputType | None) -> None:
721 """Prepares the given hooks."""
722 # hooks can be passed as None to the prepare method and to this
723 # method. To prevent iterating over None, simply use an empty list
724 # if hooks is False-y
725 hooks = hooks or {}
726 for event in hooks:
727 self.register_hook(event, hooks[event])
728
729
730class Response:

Callers 1

prepareMethod · 0.95

Calls 1

register_hookMethod · 0.80

Tested by

no test coverage detected