Ejemplo n.º 1
0
 def req(self):
     headers = Headers(header="qvalue")
     req = http.HTTPRequest("absolute", "GET", "http", "host", 80, "/path",
                            (1, 1), headers, "content_request", None, None)
     f = http.HTTPFlow(tutils.tclient_conn(), None)
     f.request = req
     return f
Ejemplo n.º 2
0
 def req(self):
     headers = odict.ODictCaseless()
     headers["header"] = ["qvalue"]
     req = http.HTTPRequest("absolute", "GET", "http", "host", 80, "/path",
                            (1, 1), headers, "content_request", None, None)
     f = http.HTTPFlow(tutils.tclient_conn(), None)
     f.request = req
     return f
Ejemplo n.º 3
0
def treq(content="content", scheme="http", host="address", port=22):
    """
    @return: libmproxy.protocol.http.HTTPRequest
    """
    headers = odict.ODictCaseless()
    headers["header"] = ["qvalue"]
    req = http.HTTPRequest("relative", "GET", scheme, host, port, "/path",
                           (1, 1), headers, content, None, None, None)
    return req
Ejemplo n.º 4
0
def treq(conn=None, content="content"):
    if not conn:
        conn = tclient_conn()
    server_conn = tserver_conn()
    headers = flow.ODictCaseless()
    headers["header"] = ["qvalue"]

    f = http.HTTPFlow(conn, server_conn)
    f.request = http.HTTPRequest("relative", "GET", None, None, None, "/path",
                                 (1, 1), headers, content, None, None, None)
    f.request.reply = controller.DummyReply()
    return f.request