async_sanic.py 文件源码

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

项目:RealtimePythonChat 作者: quangtqag 项目源码 文件源码
def make_response(status, headers, payload):
    """This function generates an appropriate response object for this async
    mode.
    """
    headers_dict = {}
    content_type = None
    for h in headers:
        if h[0].lower() == 'content-type':
            content_type = h[1]
        else:
            headers_dict[h[0]] = h[1]
    return HTTPResponse(body_bytes=payload, content_type=content_type,
                        status=int(status.split()[0]), headers=headers_dict)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号