def request(self, uri, method='<STR_LIT:GET>', body=None, headers=None,<EOL>**kwargs):
_credential_refresh_attempt = kwargs.pop(<EOL>'<STR_LIT>', <NUM_LIT:0>)<EOL>request_headers = headers.copy() if headers is not None else {}<EOL>self.credentials.before_request(<EOL>self._request, method, uri, request_headers)<EOL>body_stream_position = None<EOL>if all(getattr(body, stream_prop, None) for stream_prop in<EOL>_STREAM_PROPERTIES):<EOL><INDENT>body_stream_position = body.tell()<EOL><DEDENT>response, content = self.http.request(<EOL>uri, method, body=body, headers=request_headers, **kwargs)<EOL>if (response.status in self._refresh_status_codes<EOL>and _credential_refresh_attempt < self._max_refresh_attempts):<EOL><INDENT>_LOGGER.info(<EOL>'<STR_LIT>',<EOL>response.status, _credential_refresh_attempt + <NUM_LIT:1>,<EOL>self._max_refresh_attempts)<EOL>self.credentials.refresh(self._request)<EOL>if body_stream_position is not None:<EOL><INDENT>body.seek(body_stream_position)<EOL><DEDENT>return self.request(<EOL>uri, method, body=body, headers=headers,<EOL>_credential_refresh_attempt=_credential_refresh_attempt + <NUM_LIT:1>,<EOL>**kwargs)<EOL><DEDENT>return response, content<EOL>
Implementation of httplib2's Http.request.