• Home
  • Raw
  • Download

Lines Matching +full:get +full:- +full:content

85             "http://example.org/", httplib2.urlnorm("http://example.org")[-1]
88 "http://example.org/", httplib2.urlnorm("http://EXAMple.org")[-1]
91 "http://example.org/?=b", httplib2.urlnorm("http://EXAMple.org?=b")[-1]
95 httplib2.urlnorm("http://EXAMple.org/mypath?a=b")[-1],
98 "http://localhost:80/", httplib2.urlnorm("http://localhost:80")[-1]
106 self.fail("Non-absolute URIs should raise an exception")
127 httplib2.safename(httplib2.urlnorm("http://www")[-1]),
128 httplib2.safename(httplib2.urlnorm("http://WWW")[-1]),
147 "xn--http,-4y1d.org,fred,a=b,579924c35db315e5a32e3d9963388193",
253 self.fail("should get the address family right for IPv6")
262 self.fail("should get the address family right for IPv6")
269 response, content = self.http.request(
272 self.assertEqual(response["content-location"], "http://bitworking.org")
273 self.assertEqual(content, b"the body")
280 response, content = self.http.request(
300 (response, content) = self.http.request("http://fred.bitworking.org/")
301 self.assertEqual(response["content-type"], "text/plain")
302 self.assertTrue(content.startswith(b"Unable to find"))
316 (response, content) = self.http.request("http://localhost:7777/")
317 self.assertEqual(response["content-type"], "text/plain")
318 self.assertTrue(b"Connection refused" in content)
326 (response, content) = self.http.request(uri, "GET")
327 d = self.reflector(content)
332 # Test that GET is the default method
334 (response, content) = self.http.request(uri)
335 self.assertEqual(response["x-method"], "GET")
340 for method in ["GET", "PUT", "DELETE", "POST"]:
341 (response, content) = self.http.request(uri, method, body=b" ")
342 self.assertEqual(response["x-method"], method)
350 (response, content) = self.http.request(uri, "HEAD")
352 self.assertEqual(content, b"")
355 # Test that can do a GET w/o the cache turned on.
358 (response, content) = http.request(uri, "GET")
363 # Test that can do a GET with cache and 'only-if-cached'
365 (response, content) = self.http.request(uri, "GET")
366 (response, content) = self.http.request(
367 uri, "GET", headers={"cache-control": "only-if-cached"}
373 # Test that can do a GET with no cache with 'only-if-cached'
375 (response, content) = self.http.request(
376 uri, "GET", headers={"cache-control": "only-if-cached"}
382 # Test that can do a GET with no cache with 'only-if-cached'
384 # that responds to the 'only-if-cached', so this
388 (response, content) = http.request(
389 uri, "GET", headers={"cache-control": "only-if-cached"}
395 # Test that we provide a default user-agent
396 uri = urllib.parse.urljoin(base, "user-agent/test.cgi")
397 (response, content) = self.http.request(uri, "GET")
399 self.assertTrue(content.startswith(b"Python-httplib2/"))
402 # Test that the default user-agent can be over-ridden
404 uri = urllib.parse.urljoin(base, "user-agent/test.cgi")
405 (response, content) = self.http.request(
406 uri, "GET", headers={"User-Agent": "fred/1.0"}
409 self.assertTrue(content.startswith(b"fred/1.0"))
413 uri = urllib.parse.urljoin(base, "300/with-location-header.asis")
414 (response, content) = self.http.request(uri, "GET")
416 self.assertEqual(content, b"This is the final destination.\n")
421 (response, content) = self.http.request(uri, "GET")
423 self.assertEqual(content, b"This is the final destination.\n")
430 uri = urllib.parse.urljoin(base, "300/with-location-header.asis")
431 (response, content) = self.http.request(uri, "GET")
437 uri = urllib.parse.urljoin(base, "300/without-location-header.asis")
438 (response, content) = self.http.request(uri, "GET")
440 self.assertTrue(response["content-type"].startswith("text/html"))
447 destination = urllib.parse.urljoin(base, "302/final-destination.txt")
448 (response, content) = self.http.request(uri, "GET")
450 self.assertTrue("content-location" in response)
451 self.assertEqual(response["content-location"], destination)
452 self.assertEqual(content, b"This is the final destination.\n")
456 (response, content) = self.http.request(uri, "GET")
458 self.assertEqual(response["content-location"], destination)
459 self.assertEqual(content, b"This is the final destination.\n")
466 (response, content) = self.http.request(uri, "HEAD")
476 destination = urllib.parse.urljoin(base, "302/final-destination.txt")
477 (response, content) = self.http.request(uri, "GET")
484 destination = urllib.parse.urljoin(base, "302/final-destination.txt")
485 (response, content) = self.http.request(uri, "GET")
487 self.assertEqual(response["content-location"], destination)
488 self.assertEqual(content, b"This is the final destination.\n")
493 (response, content) = self.http.request(uri, "GET")
496 self.assertEqual(response["content-location"], destination)
497 self.assertEqual(content, b"This is the final destination.\n")
500 self.assertEqual(response.previous["content-location"], uri)
504 (response, content) = self.http.request(uri, "GET")
507 self.assertEqual(content, b"This is the final destination.\n")
519 (response, content) = self.http.request(uri, "GET", redirections=1)
526 # Re-run the test with out the exceptions
529 (response, content) = self.http.request(uri, "GET", redirections=1)
533 self.assertTrue(content.startswith(b"<html>"))
537 # Test that we throw an exception when we get
540 uri = urllib.parse.urljoin(base, "302/no-location.asis")
542 (response, content) = self.http.request(uri, "GET")
549 # Re-run the test with out the exceptions
552 (response, content) = self.http.request(uri, "GET")
556 self.assertTrue(content.startswith(b"This is content"))
560 (response, content) = self.http.request("https://code.google.com/apis/", "GET")
566 (response, content) = self.http.request("https://google.com/adsense/", "GET")
574 (response, content) = self.http.request("https://google.com/adsense", "GET")
587 (response, content) = http.request("https://bitworking.org", "GET")
600 (response, content) = http.request("https://notthere.bitworking.org", "GET")
613 # Test that we get an ssl.SSLError when specifying a non-existent CA
616 self.assertRaises(IOError, http.request, "https://www.google.com/", "GET")
618 # Test that we get a SSLHandshakeError if we try to access
628 self.assertRaises(ssl.SSLError, http.request, "https://www.google.com/", "GET")
631 self.http.request("https://google.com/", method="GET")
634 # Do a follow-up GET on a Location: header
637 (response, content) = self.http.request(uri, "POST", " ")
639 self.assertEqual(content, b"This is the final destination.\n")
643 # Do a follow-up GET on a Location: header
647 (response, content) = self.http.request(uri, "POST", " ")
652 uri = urllib.parse.urljoin(base, "303/redirect-to-reflector.cgi")
654 ("PUT", "GET"),
655 ("DELETE", "GET"),
656 ("POST", "GET"),
657 ("GET", "GET"),
658 ("HEAD", "GET"),
660 (response, content) = self.http.request(uri, method, body=b" ")
661 self.assertEqual(response["x-method"], method_on_303)
666 (response, content) = self.http.request(
667 uri, "GET", headers={"accept-encoding": "identity"}
671 (response, content) = self.http.request(
672 uri, "GET", headers={"accept-encoding": "identity"}
674 (response, content) = self.http.request(
676 "GET",
677 headers={"accept-encoding": "identity", "cache-control": "must-revalidate"},
683 cacheDirName, httplib2.safename(httplib2.urlnorm(uri)[-1])
691 (response, content) = self.http.request(
692 uri, "HEAD", headers={"accept-encoding": "identity"}
697 (response, content) = self.http.request(
698 uri, "GET", headers={"accept-encoding": "identity", "range": "bytes=0-0"}
706 (response, content) = self.http.request(
707 uri, "GET", headers={"accept-encoding": "identity"}
711 (response, content) = self.http.request(
713 "GET",
714 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
716 d = self.reflector(content)
720 (response, content) = self.http.request(
722 "GET",
723 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
725 d = self.reflector(content)
732 (response, content) = self.http.request(
733 uri, "GET", headers={"accept-encoding": "identity"}
737 (response, content) = self.http.request(
739 "GET",
740 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
742 d = self.reflector(content)
746 (response, content) = self.http.request(
748 "GET",
750 "accept-encoding": "identity",
751 "cache-control": "max-age=0",
752 "if-none-match": "fred",
755 d = self.reflector(content)
759 # MAP-commented this out because it consistently fails
761 # # Test that end to end headers get overwritten in the cache
763 # (response, content) = self.http.request(uri, "GET")
768 …# (response, content) = self.http.request(uri, "GET", headers = {'Cache-Control': 'max-age=…
777 # by only using the last-modified cache validator.
779 base, "304/last-modified-only/last-modified-only.txt"
781 (response, content) = self.http.request(uri, "GET")
783 self.assertNotEqual(response["last-modified"], "")
784 (response, content) = self.http.request(uri, "GET")
785 (response, content) = self.http.request(uri, "GET")
793 (response, content) = self.http.request(uri, "GET")
795 self.assertEqual(content, b"This is the final destination.\n")
799 (response, content) = self.http.request(uri, "GET")
802 self.assertEqual(content, b"This is the final destination.\n")
809 (response, content) = self.http.request(uri, "GET")
813-URI specifies one or more cache entries including a Vary header field, the cache MUST NOT use suc…
818 (response, content) = self.http.request(
819 uri, "GET", headers={"Accept": "text/plain"}
824 # get the resource again, from the cache since accept header in this
826 (response, content) = self.http.request(
827 uri, "GET", headers={"Accept": "text/plain"}
832 # get the resource again, not from cache since Accept headers does not match
833 (response, content) = self.http.request(
834 uri, "GET", headers={"Accept": "text/html"}
839 # get the resource again, without any Accept header, so again no match
840 (response, content) = self.http.request(uri, "GET")
849 # uri = urllib.parse.urljoin(base, "vary/no-vary.asis")
850 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
854 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
858 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/html'})
863 uri = urllib.parse.urljoin(base, "vary/accept-double.asis")
864 (response, content) = self.http.request(
866 "GET",
869 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
876 (response, content) = self.http.request(
878 "GET",
881 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
886 (response, content) = self.http.request(
887 uri, "GET", headers={"Accept": "text/plain"}
892 # get the resource again, not from cache, varied headers don't match exact
893 (response, content) = self.http.request(
894 uri, "GET", headers={"Accept-Language": "da"}
901 uri = urllib.parse.urljoin(base, "vary/unused-header.asis")
902 (response, content) = self.http.request(
903 uri, "GET", headers={"Accept": "text/plain"}
909 (response, content) = self.http.request(
910 uri, "GET", headers={"Accept": "text/plain"}
916 uri = urllib.parse.urljoin(base, "gzip/final-destination.txt")
917 (response, content) = self.http.request(uri, "HEAD")
919 self.assertNotEqual(int(response["content-length"]), 0)
920 self.assertEqual(content, b"")
924 uri = urllib.parse.urljoin(base, "gzip/final-destination.txt")
925 (response, content) = self.http.request(uri, "GET")
927 self.assertFalse("content-encoding" in response)
928 self.assertTrue("-content-encoding" in response)
930 int(response["content-length"]), len(b"This is the final destination.\n")
932 self.assertEqual(content, b"This is the final destination.\n")
936 (response, content) = self.http.request(uri, "POST", body=" ")
938 self.assertFalse("content-encoding" in response)
939 self.assertTrue("-content-encoding" in response)
944 uri = urllib.parse.urljoin(base, "gzip/failed-compression.asis")
946 (response, content) = self.http.request(uri, "GET")
953 # Re-run the test with out the exceptions
956 (response, content) = self.http.request(uri, "GET")
958 self.assertTrue(response.reason.startswith("Content purported"))
965 (response, content) = http.request(uri)
968 self.assertTrue(content.startswith(b"Request Timeout"))
973 (response, content) = self.http.request(uri, "GET")
975 self.assertFalse("content-encoding" in response)
977 int(response["content-length"]), len("This is the final destination.")
979 self.assertEqual(content, b"This is the final destination.")
985 uri = urllib.parse.urljoin(base, "deflate/failed-compression.asis")
987 (response, content) = self.http.request(uri, "GET")
994 # Re-run the test with out the exceptions
997 (response, content) = self.http.request(uri, "GET")
999 self.assertTrue(response.reason.startswith("Content purported"))
1002 # Test that duplicate headers get concatenated via ','
1003 uri = urllib.parse.urljoin(base, "duplicate-headers/multilink.asis")
1004 (response, content) = self.http.request(uri, "GET")
1006 self.assertEqual(content, b"This is content\n")
1013 # Test Cache-Control: no-cache on requests
1015 (response, content) = self.http.request(
1016 uri, "GET", headers={"accept-encoding": "identity"}
1019 (response, content) = self.http.request(
1020 uri, "GET", headers={"accept-encoding": "identity"}
1025 (response, content) = self.http.request(
1027 "GET",
1028 headers={"accept-encoding": "identity", "Cache-Control": "no-cache"},
1034 # Test Pragma: no-cache on requests
1036 (response, content) = self.http.request(
1037 uri, "GET", headers={"accept-encoding": "identity"}
1040 (response, content) = self.http.request(
1041 uri, "GET", headers={"accept-encoding": "identity"}
1046 (response, content) = self.http.request(
1047 uri, "GET", headers={"accept-encoding": "identity", "Pragma": "no-cache"}
1053 # A no-store request means that the response should not be stored.
1056 (response, content) = self.http.request(
1057 uri, "GET", headers={"Cache-Control": "no-store"}
1062 (response, content) = self.http.request(
1063 uri, "GET", headers={"Cache-Control": "no-store"}
1069 # A no-store response means that the response should not be stored.
1070 uri = urllib.parse.urljoin(base, "no-store/no-store.asis")
1072 (response, content) = self.http.request(uri, "GET")
1076 (response, content) = self.http.request(uri, "GET")
1081 # Test that a no-store, no-cache clears the entry from the cache
1085 (response, content) = self.http.request(uri, "GET")
1086 (response, content) = self.http.request(uri, "GET")
1088 (response, content) = self.http.request(
1089 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
1091 (response, content) = self.http.request(
1092 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
1102 (response, content) = self.http.request(uri, "GET")
1103 (response, content) = self.http.request(uri, "GET")
1105 (response, content) = self.http.request(uri, "DELETE")
1108 (response, content) = self.http.request(uri, "GET")
1113 uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
1115 (response, content) = self.http.request(uri, "GET")
1118 (response, content) = self.http.request(uri, "GET")
1121 (response, content) = self.http.request(uri, "PUT", body="foo")
1123 (response, content) = self.http.request(uri, "PUT", body="foo")
1128 uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
1130 (response, content) = self.http.request(uri, "GET")
1133 (response, content) = self.http.request(uri, "GET")
1136 (response, content) = self.http.request(uri, "PATCH", body="foo")
1138 (response, content) = self.http.request(uri, "PATCH", body="foo")
1143 uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
1145 (response, content) = self.http.request(uri, "GET")
1148 (response, content) = self.http.request(uri, "GET")
1152 (response, content) = self.http.request(uri, "DELETE")
1157 uri = urllib.parse.urljoin(base, "conditional-updates/test.cgi")
1159 (response, content) = self.http.request(uri, "GET")
1162 (response, content) = self.http.request(uri, "GET")
1165 (response, content) = self.http.request(
1166 uri, "PUT", body="foo", headers={"if-match": "fred"}
1173 (response, content) = self.http.request(uri, "GET")
1177 (response, content) = self.http.request(uri, "GET")
1181 (response, content) = self.http.request(uri, "GET")
1185 (response, content) = self.http.request(uri, "GET")
1191 (response, content) = self.http.request(uri, "GET")
1195 (response, content) = self.http.request(uri, "GET")
1199 (response, content) = self.http.request(uri, "GET")
1203 (response, content) = self.http.request(uri, "GET")
1208 (response, content) = self.http.request(uri, "GET")
1212 (response, content) = self.http.request(uri, "GET")
1218 (response, content) = self.http.request(uri, "GET")
1222 (response, content) = self.http.request(uri, "GET")
1226 (response, content) = self.http.request(uri, "GET")
1230 (response, content) = self.http.request(uri, "GET")
1236 uri = urllib.parse.urljoin(base, "basic-nested/")
1237 (response, content) = self.http.request(uri, "GET")
1240 uri = urllib.parse.urljoin(base, "basic-nested/subdir")
1241 (response, content) = self.http.request(uri, "GET")
1247 uri = urllib.parse.urljoin(base, "basic-nested/")
1248 (response, content) = self.http.request(uri, "GET")
1251 uri = urllib.parse.urljoin(base, "basic-nested/subdir")
1252 (response, content) = self.http.request(uri, "GET")
1257 uri = urllib.parse.urljoin(base, "basic-nested/")
1258 (response, content) = self.http.request(uri, "GET")
1261 uri = urllib.parse.urljoin(base, "basic-nested/subdir")
1262 (response, content) = self.http.request(uri, "GET")
1268 (response, content) = self.http.request(uri, "GET")
1272 (response, content) = self.http.request(uri, "GET")
1276 (response, content) = self.http.request(uri, "GET")
1283 (response, content) = self.http.request(
1284 uri, "GET", headers={"cache-control": "no-cache"}
1286 info = httplib2._parse_www_authenticate(response, "authentication-info")
1288 (response, content) = self.http.request(
1289 uri, "GET", headers={"cache-control": "no-cache"}
1291 info2 = httplib2._parse_www_authenticate(response, "authentication-info")
1299 uri = urllib.parse.urljoin(base, "digest-expire/file.txt")
1301 (response, content) = self.http.request(
1302 uri, "GET", headers={"cache-control": "no-cache"}
1304 info = httplib2._parse_www_authenticate(response, "authentication-info")
1310 (response, content) = self.http.request(
1311 uri, "GET", headers={"cache-control": "no-cache"}
1315 info3 = httplib2._parse_www_authenticate(response, "authentication-info")
1318 def reflector(self, content): argument
1322 for x in content.decode("utf-8").strip().split("\n")
1328 (response, content) = self.http.request(uri, "GET")
1329 d = self.reflector(content)
1334 (response, content) = self.http.request(uri, "GET")
1337 (response, content) = self.http.request(
1338 uri, "GET", headers={"connection": "close"}
1403 # ------------------------------------------------------------------------
1408 # Test that we can parse the Cache-Control header
1411 {"no-cache": 1},
1412 httplib2._parse_cache_control({"cache-control": " no-cache"}),
1415 {"cache-control": " no-cache, max-age = 7200"}
1417 self.assertEqual(cc["no-cache"], 1)
1418 self.assertEqual(cc["max-age"], "7200")
1419 cc = httplib2._parse_cache_control({"cache-control": " , "})
1424 {"cache-control": "Max-age=3600;post-check=1800,pre-check=3600"}
1426 self.assertTrue("max-age" in cc)
1432 h = httplib2._normalize_headers({"Cache-Control": "no-cache", "Other": "Stuff"})
1433 self.assertTrue("cache-control" in h)
1444 # Test that no-cache makes our request TRANSPARENT
1445 response_headers = {"cache-control": "max-age=7200"}
1446 request_headers = {"cache-control": "no-cache"}
1453 # Test that no-cache makes our request TRANSPARENT
1454 response_headers = {"cache-control": "max-age=fred, min-fresh=barney"}
1462 # FRESH, but the no-cache over-rides that.
1467 "cache-control": "no-cache",
1475 # must-revalidate forces STALE
1478 httplib2._entry_disposition({}, {"cache-control": "must-revalidate"}),
1482 # must-revalidate forces STALE
1485 httplib2._entry_disposition({"cache-control": "must-revalidate"}, {}),
1491 "cache-control": "max-age=2",
1505 "cache-control": "max-age=0",
1550 request_headers = {"cache-control": "only-if-cached"}
1559 "cache-control": "max-age=2",
1561 request_headers = {"cache-control": "max-age=0"}
1572 request_headers = {"cache-control": "min-fresh=2"}
1583 request_headers = {"cache-control": "min-fresh=2"}
1596 "www-authenticate": 'Test realm="test realm" , foo=foo ,bar="bar", baz=baz,qux=qux'
1602 # tokens with non-alphanum
1604 {"www-authenticate": 'T*!%#st realm=to*!%#en, to*!%#en="quoted string"'}
1611 {"www-authenticate": 'Test realm="a \\"test\\" realm"'}
1622 res = httplib2._parse_www_authenticate({"www-authenticate": 'Basic realm="me"'})
1627 {"www-authenticate": 'Basic realm="me", algorithm="MD5"'}
1634 {"www-authenticate": 'Basic realm="me", algorithm=MD5'}
1642 {"www-authenticate": 'Basic realm="me",other="fred" '}
1650 {"www-authenticate": 'Basic REAlm="me" '}
1658 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1663 self.assertEqual("auth,auth-int", digest["qop"])
1668 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1673 self.assertEqual("auth,auth-int", digest["qop"])
1680 # Handle an added comma between challenges, which might get thrown in if the challenges were
1681 # originally sent in separate www-authenticate headers.
1684 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1689 self.assertEqual("auth,auth-int", digest["qop"])
1696 # Handle an added comma between challenges, which might get thrown in if the challenges were
1697 # originally sent in separate www-authenticate headers.
1700 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1705 self.assertEqual("auth,auth-int", digest["qop"])
1717 …"www-authenticate": 'Digest realm="test-real.m@host.com", qop \t=\t"\tauth,auth-int", nonce="(*)&^…
1721 self.assertEqual("test-real.m@host.com", digest["realm"])
1722 self.assertEqual("\tauth,auth-int", digest["qop"])
1728 …"www-authenticate": 'Digest realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d47…
1738 … "www-authenticate": 'OAuth "Facebook Platform" "invalid_token" "Invalid OAuth access token."'
1751 "www-authenticate": 'Digest realm="myrealm", '
1755 content = b""
1758 credentials, host, request_uri, headers, response, content, None
1760 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1777 "www-authenticate": 'Digest realm="myrealm", '
1781 content = ""
1784 credentials, host, request_uri, headers, response, content, None
1786 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1804 response["www-authenticate"] = (
1810 content = b""
1812 credentials, host, request_uri, headers, response, content, None
1815 self.assertTrue(d.response(response, content))
1823 response["www-authenticate"] = (
1828 response["authentication-info"] = 'nextnonce="fred"'
1829 content = b""
1831 credentials, host, request_uri, headers, response, content, None
1834 self.assertFalse(d.response(response, content))
1840 "d36e316282959a9ed4c89851497a717f", "2003-12-15T14:43:07Z", "taadtaadpstcsm"
1847 response = {"content-type": "application/atom+xml", "te": "deflate"}
1849 self.assertTrue("content-type" in end2end)
1855 "connection": "content-type",
1856 "content-type": "application/atom+xml",
1860 self.assertTrue("content-type" not in end2end)
1870 response = {"connection": "content-type"}
1924 connection.request("GET", "/")