responseHandler: a callable that determines how the response is handled. See qwarc.utils.handle_response_default for details.
responseHandler: None or a callable that determines how the response is handled; if None, self.defaultResponseHandler is used. See qwarc.utils.handle_response_default for details.
method: str, must be 'GET' or 'POST'
data: dict or list/tuple of lists/tuples of length two or bytes or file-like or None, the data to be sent in the request body
headers: list of 2-tuples, additional or overriding headers for this request only
@@ -80,6 +81,8 @@ class Item:
#TODO: Rewrite using 'async with self.session.get'
url = yarl.URL(url) # Explicitly convert for normalisation, percent-encoding, etc.
if responseHandler is None:
responseHandler = self.defaultResponseHandler
assert method in ('GET', 'POST'), 'method must be GET or POST'