def _do_revoke(self, http, token):
logger.info('<STR_LIT>')<EOL>query_params = {'<STR_LIT>': token}<EOL>token_revoke_uri = _helpers.update_query_params(<EOL>self.revoke_uri, query_params)<EOL>resp, content = transport.request(http, token_revoke_uri)<EOL>if resp.status == http_client.METHOD_NOT_ALLOWED:<EOL><INDENT>body = urllib.parse.urlencode(query_params)<EOL>resp, content = transport.request(http, token_revoke_uri,<EOL>method='<STR_LIT:POST>', body=body)<EOL><DEDENT>if resp.status == http_client.OK:<EOL><INDENT>self.invalid = True<EOL><DEDENT>else:<EOL><INDENT>error_msg = '<STR_LIT>'.format(resp.status)<EOL>try:<EOL><INDENT>d = json.loads(_helpers._from_bytes(content))<EOL>if '<STR_LIT:error>' in d:<EOL><INDENT>error_msg = d['<STR_LIT:error>']<EOL><DEDENT><DEDENT>except (TypeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>raise TokenRevokeError(error_msg)<EOL><DEDENT>if self.store:<EOL><INDENT>self.store.delete()<EOL><DEDENT>
Revokes this credential and deletes the stored copy (if it exists).

        Args:
            http: an object to be used to make HTTP requests.
            token: A string used as the token to be revoked. Can be either an
                   access_token or refresh_token.

        Raises:
            TokenRevokeError: If the revoke request does not return with a
                              200 OK.