seleniumwire.thirdparty.mitmproxy.net.http.request.Request

Here are the examples of the python api seleniumwire.thirdparty.mitmproxy.net.http.request.Request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : read.py
with MIT License
from wkeeling

def read_request_head(rfile):
    """
    Parse an HTTP request head (request line + headers) from an input stream

    Args:
        rfile: The input stream

    Returns:
        The HTTP request object (without body)

    Raises:
        exceptions.HttpReadDisconnect: No bytes can be read from rfile.
        exceptions.HttpSyntaxException: The input is malformed HTTP.
        exceptions.HttpException: Any other error occurred.
    """
    timestamp_start = time.time()
    if hasattr(rfile, "reset_timestamps"):
        rfile.reset_timestamps()

    host, port, method, scheme, authority, path, http_version = _read_request_line(rfile)
    headers = _read_headers(rfile)

    if hasattr(rfile, "first_byte_timestamp"):
        # more accurate timestamp_start
        timestamp_start = rfile.first_byte_timestamp

    return request.Request(
        host, port, method, scheme, authority, path, http_version, headers, None, None, timestamp_start, None
    )


def read_response(rfile, request, body_size_limit=None):