def headers_to_dict(raw_headers): """header转换为字典""" return dict([k.strip() for k in i.split(": ", 1)] for i in raw_headers.split(' '))