auth = auth.apply_auth()
else:
headers["Authorization"] = f"Bearer {self.bearer_token}"
+
log.debug(
f"Making API request: {method} {host + route}\n"
f"Parameters: {params}\n"
f"Headers: {headers}\n"
f"Body: {json}"
)
+
with self.session.request(
method, host + route, params=params, json=json, headers=headers,
auth=auth
f"Headers: {response.headers}\n"
f"Content: {response.content}"
)
+
if response.status_code == 400:
raise BadRequest(response)
if response.status_code == 401:
raise TwitterServerError(response)
if not 200 <= response.status_code < 300:
raise HTTPException(response)
+
return response
def _make_request(self, method, route, params={}, endpoint_parameters=None,