__init__.py 文件源码

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

项目:sndlatr 作者: Schibum 项目源码 文件源码
def send_request(self, path, post=None, json_data=None, headers=None,
                     method=None):
        """
        Send request to main app. Returns response object.
        If json_data is given (dict) it is encoded and sent as post payload.
        """
        if headers is None:
            headers = {}
        if json_data is not None:
            post = json.dumps(json_data)
            headers['Content-Type'] = 'application/json'
        request = webapp2.Request.blank(path, POST=post, headers=headers)
        if method:
            request.method = method
        return request.get_response(main.app)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号