http.py 文件源码

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

项目:office-interoperability-tools 作者: milossramek 项目源码 文件源码
def request(self, uri,
              method='GET',
              body=None,
              headers=None,
              redirections=1,
              connection_type=None):
    resp, content = self._iterable.pop(0)
    if content == 'echo_request_headers':
      content = headers
    elif content == 'echo_request_headers_as_json':
      content = simplejson.dumps(headers)
    elif content == 'echo_request_body':
      if hasattr(body, 'read'):
        content = body.read()
      else:
        content = body
    elif content == 'echo_request_uri':
      content = uri
    return httplib2.Response(resp), content
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号