@classmethod
def from_wsgi(cls, environ: dict) -> 'HttpRequest':
    headers = Headers()
    for (key, value) in environ.items():
        if (not key.startswith('HTTP')):
            continue
        headers.set(key, value)
    headers.set('Content-Type', environ.get('CONTENT_TYPE', 'text/plain'))
    return cls(method=HttpMethod(environ.get('REQUEST_METHOD', 'GET').upper()), uri=environ.get('PATH_INFO', '/'), body=environ.get('wsgi.input', BytesIO(b'')), query_string=QueryString(environ.get('QUERY_STRING', '')), headers=headers)
@classmethod
def from_wsgi(cls, environ: dict) -> 'HttpRequest':
    headers = Headers()
    for (key, value) in environ.items():
        if (not key.startswith('HTTP')):
            continue
        headers.set(key, value)
    headers.set('Content-Type', environ.get('CONTENT_TYPE', 'text/plain'))
    return cls(method=HttpMethod(environ.get('REQUEST_METHOD', 'GET').upper()), uri=environ.get('PATH_INFO', '/'), body=environ.get('wsgi.input', BytesIO(b)), query_string=QueryString(environ.get('QUERY_STRING', )), headers=headers)