model.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:GAMADV-XTD 作者: taers232c 项目源码 文件源码
def response(self, resp, content):
    """Convert the response wire format into a Python object.

    Args:
      resp: httplib2.Response, the HTTP response headers and status
      content: string, the body of the HTTP response

    Returns:
      The body de-serialized as a Python object.

    Raises:
      googleapiclient.errors.HttpError if a non 2xx response is received.
    """
    self._log_response(resp, content)
    # Error handling is TBD, for example, do we retry
    # for some operation/error combinations?
    if resp.status < 300:
      if resp.status == 204:
        # A 204: No Content response should be treated differently
        # to all the other success states
        return self.no_content_response
      return self.deserialize(content)
    else:
      LOGGER.debug('Content from bad request was: %s' % content)
      raise HttpError(resp, content)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号