Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(34)  |  Call(34)  |  Derive(0)  |  Import(0)
Perform HTTP request.

Parameters:
    uripath     URI reference of resource to access, resolved against the base URI of
                the current HTTP_Session object.
    method      HTTP method to use (default GET)
    body        request body to use (default none)
    ctype       content-type of request body (default none)
    accept      string containing list of content types for HTTP accept header
    reqheaders  dictionary of additional header fields to send with the HTTP request(more...)

src/r/o/ro-manager-HEAD/src/rocommand/ROSRS_Session.py   ro-manager(Download)
        Result is list of dictionaries, where dict["uri"] is the URI of an RO.
        """
        (status, reason, headers, data) = self.doRequest("")
        if status < 200 or status >= 300:
            raise self.error("Error listing ROs", "%03d %s"%(status, reason))
        if purge:
            reqheaders={"Purge": "True"}
        (status, reason, headers, data) = self.doRequest(rouri,
            method="DELETE", reqheaders=reqheaders)
        if status in [204, 404]:
            </rdf:RDF>
            """)
        (status, reason, headers, data) = self.doRequest(rouri,
            method="POST", ctype="application/vnd.wf4ever.proxy",
            reqheaders=reqheaders, body=proxydata)
        resuri   = rdflib.URIRef(links[str(ORE.proxyFor)])
        # PUT resource content to indicated URI
        (status, reason, headers, data) = self.doRequest(resuri,
            method="PUT", ctype=ctype, body=body)
        if status not in [200,201]:
            </rdf:RDF>
            """)%str(resuri)
        (status, reason, headers, data) = self.doRequest(rouri,
            method="POST", ctype="application/vnd.wf4ever.proxy",
            body=proxydata)

src/r/o/ro-manager-0.2.20/rocommand/ROSRS_Session.py   ro-manager(Download)
        Result is list of dictionaries, where dict["uri"] is the URI of an RO.
        """
        (status, reason, headers, data) = self.doRequest("")
        if status < 200 or status >= 300:
            raise self.error("Error listing ROs", "%03d %s"%(status, reason))
        if purge:
            reqheaders={"Purge": "True"}
        (status, reason, headers, data) = self.doRequest(rouri,
            method="DELETE", reqheaders=reqheaders)
        if status in [204, 404]:
            </rdf:RDF>
            """)
        (status, reason, headers, data) = self.doRequest(rouri,
            method="POST", ctype="application/vnd.wf4ever.proxy",
            reqheaders=reqheaders, body=proxydata)
        resuri   = rdflib.URIRef(links[str(ORE.proxyFor)])
        # PUT resource content to indicated URI
        (status, reason, headers, data) = self.doRequest(resuri,
            method="PUT", ctype=ctype, body=body)
        if status not in [200,201]:
            </rdf:RDF>
            """)%str(resuri)
        (status, reason, headers, data) = self.doRequest(rouri,
            method="POST", ctype="application/vnd.wf4ever.proxy",
            body=proxydata)

src/r/o/ro-manager-HEAD/src/roverlay/rovweb/rovserver/tests.py   ro-manager(Download)
        with MockHttpFileResources(testbaseuri, testbasepath):
            hs = HTTP_Session(testbaseuri)
            (status, reason, headers, body) = hs.doRequest("README-ro-test-1.txt")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "text/plain")
            self.assertRegexpMatches(body, "README-ro-test-1")
            (status, reason, headers, body) = hs.doRequest("README-ro-test-1.txt", method="HEAD")
            self.assertEquals(headers["content-type"], "text/plain")
            self.assertEquals(body, "")
            (status, reason, headers, body) = hs.doRequest("subdir1/subdir1-file.txt")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "text/plain")
            (status, reason, headers, body) = hs.doRequest("minim.rdf", method="HEAD")
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "application/rdf+xml")
            (status, reason, headers, body) = hs.doRequest("filename%20with%20spaces.txt", method="HEAD")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")

src/r/o/ro-manager-0.2.20/roverlay/rovweb/rovserver/tests.py   ro-manager(Download)
        with MockHttpFileResources(testbaseuri, testbasepath):
            hs = HTTP_Session(testbaseuri)
            (status, reason, headers, body) = hs.doRequest("README-ro-test-1.txt")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "text/plain")
            self.assertRegexpMatches(body, "README-ro-test-1")
            (status, reason, headers, body) = hs.doRequest("README-ro-test-1.txt", method="HEAD")
            self.assertEquals(headers["content-type"], "text/plain")
            self.assertEquals(body, "")
            (status, reason, headers, body) = hs.doRequest("subdir1/subdir1-file.txt")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "text/plain")
            (status, reason, headers, body) = hs.doRequest("minim.rdf", method="HEAD")
            self.assertEquals(reason, "OK")
            self.assertEquals(headers["content-type"], "application/rdf+xml")
            (status, reason, headers, body) = hs.doRequest("filename%20with%20spaces.txt", method="HEAD")
            self.assertEquals(status, 200)
            self.assertEquals(reason, "OK")