• Home
  • Raw
  • Download

Lines Matching +full:get +full:- +full:uri

32 # The test resources base uri
96 "http://example.org/", httplib2.urlnorm("http://example.org")[-1]
99 "http://example.org/", httplib2.urlnorm("http://EXAMple.org")[-1]
102 "http://example.org/?=b", httplib2.urlnorm("http://EXAMple.org?=b")[-1]
106 httplib2.urlnorm("http://EXAMple.org/mypath?a=b")[-1],
109 "http://localhost:80/", httplib2.urlnorm("http://localhost:80")[-1]
117 self.fail("Non-absolute URIs should raise an exception")
138 httplib2.safename(httplib2.urlnorm("http://www")[-1]),
139 httplib2.safename(httplib2.urlnorm("http://WWW")[-1]),
149 uri = "http://" + ("w" * 200) + ".org"
151 self.assertNotEqual(httplib2.safename(uri2), httplib2.safename(uri))
154 self.assertEqual(233, len(httplib2.safename(uri)))
158 "xn--http,-4y1d.org,fred,a=b,579924c35db315e5a32e3d9963388193",
268 self.fail("should get the address family right for IPv6")
277 self.fail("should get the address family right for IPv6")
291 self.assertEqual(response["content-location"], "http://bitworking.org")
320 self.assertEqual(response["content-type"], "text/plain")
336 self.assertEqual(response["content-type"], "text/plain")
345 uri = urlparse.urljoin(
348 (response, content) = self.http.request(uri, "GET")
354 # Test that GET is the default method
355 uri = urlparse.urljoin(base, "methods/method_reflector.cgi")
356 (response, content) = self.http.request(uri)
357 self.assertEqual(response["x-method"], "GET")
361 uri = urlparse.urljoin(base, "methods/method_reflector.cgi")
362 for method in ["GET", "PUT", "DELETE", "POST"]:
363 (response, content) = self.http.request(uri, method, body=" ")
364 self.assertEqual(response["x-method"], method)
371 uri = "http://www.google.com/"
372 (response, content) = self.http.request(uri, "HEAD")
377 # Test that can do a GET w/o the cache turned on.
379 uri = urlparse.urljoin(base, "304/test_etag.txt")
380 (response, content) = http.request(uri, "GET")
385 # Test that can do a GET with cache and 'only-if-cached'
386 uri = urlparse.urljoin(base, "304/test_etag.txt")
387 (response, content) = self.http.request(uri, "GET")
389 uri, "GET", headers={"cache-control": "only-if-cached"}
395 # Test that can do a GET with no cache with 'only-if-cached'
396 uri = urlparse.urljoin(base, "304/test_etag.txt")
398 uri, "GET", headers={"cache-control": "only-if-cached"}
404 # Test that can do a GET with no cache with 'only-if-cached'
406 # that responds to the 'only-if-cached', so this
409 uri = urlparse.urljoin(base, "304/test_etag.txt")
411 uri, "GET", headers={"cache-control": "only-if-cached"}
417 # Test that we provide a default user-agent
418 uri = urlparse.urljoin(base, "user-agent/test.cgi")
419 (response, content) = self.http.request(uri, "GET")
421 self.assertTrue(content.startswith("Python-httplib2/"))
424 # Test that the default user-agent can be over-ridden
426 uri = urlparse.urljoin(base, "user-agent/test.cgi")
428 uri, "GET", headers={"User-Agent": "fred/1.0"}
435 uri = urlparse.urljoin(base, "300/with-location-header.asis")
436 (response, content) = self.http.request(uri, "GET")
443 (response, content) = self.http.request(uri, "GET")
452 uri = urlparse.urljoin(base, "300/with-location-header.asis")
453 (response, content) = self.http.request(uri, "GET")
459 uri = urlparse.urljoin(base, "300/without-location-header.asis")
460 (response, content) = self.http.request(uri, "GET")
462 self.assertTrue(response["content-type"].startswith("text/html"))
468 uri = urlparse.urljoin(base, "301/onestep.asis")
469 destination = urlparse.urljoin(base, "302/final-destination.txt")
470 (response, content) = self.http.request(uri, "GET")
472 self.assertTrue("content-location" in response)
473 self.assertEqual(response["content-location"], destination)
478 (response, content) = self.http.request(uri, "GET")
480 self.assertEqual(response["content-location"], destination)
487 uri = urlparse.urljoin(base, "301/onestep.asis")
488 destination = urlparse.urljoin(base, "302/final-destination.txt")
489 (response, content) = self.http.request(uri, "HEAD")
498 uri = urlparse.urljoin(base, "301/onestep.asis")
499 destination = urlparse.urljoin(base, "302/final-destination.txt")
500 (response, content) = self.http.request(uri, "GET")
506 uri = urlparse.urljoin(base, "302/onestep.asis")
507 destination = urlparse.urljoin(base, "302/final-destination.txt")
508 (response, content) = self.http.request(uri, "GET")
510 self.assertEqual(response["content-location"], destination)
515 uri = urlparse.urljoin(base, "302/onestep.asis")
516 (response, content) = self.http.request(uri, "GET")
519 self.assertEqual(response["content-location"], destination)
523 self.assertEqual(response.previous["content-location"], uri)
525 uri = urlparse.urljoin(base, "302/twostep.asis")
527 (response, content) = self.http.request(uri, "GET")
540 uri = urlparse.urljoin(base, "302/twostep.asis")
542 (response, content) = self.http.request(uri, "GET", redirections=1)
549 # Re-run the test with out the exceptions
552 (response, content) = self.http.request(uri, "GET", redirections=1)
560 # Test that we throw an exception when we get
563 uri = urlparse.urljoin(base, "302/no-location.asis")
565 (response, content) = self.http.request(uri, "GET")
572 # Re-run the test with out the exceptions
575 (response, content) = self.http.request(uri, "GET")
583 (response, content) = self.http.request("https://code.google.com/apis/", "GET")
590 "https://www.google.com/adsense/", "GET"
599 (response, content) = self.http.request("https://www.google.com/adsense", "GET")
607 # Test that we get match a double dot cert
609 # self.http.request("https://www.appspot.com/", "GET")
623 # self.http.request, "https://google.com/", "GET")
632 "GET",
641 # bitworking.org presents an certificate for a non-matching host
647 (response, content) = http.request("https://bitworking.org", "GET")
656 (response, content) = http.request("https://notthere.bitworking.org", "GET")
667 # Do a follow-up GET on a Location: header
669 uri = urlparse.urljoin(base, "303/303.cgi")
670 (response, content) = self.http.request(uri, "POST", " ")
676 # Do a follow-up GET on a Location: header
679 uri = urlparse.urljoin(base, "303/303.cgi")
680 (response, content) = self.http.request(uri, "POST", " ")
685 uri = urlparse.urljoin(base, "303/redirect-to-reflector.cgi")
687 ("PUT", "GET"),
688 ("DELETE", "GET"),
689 ("POST", "GET"),
690 ("GET", "GET"),
691 ("HEAD", "GET"),
693 (response, content) = self.http.request(uri, method, body=" ")
694 self.assertEqual(response["x-method"], method_on_303)
698 uri = urlparse.urljoin(base, "303/redirect-to-header-reflector.cgi")
700 response, content = self.http.request(uri, "GET", body=" ", headers=headers)
704 response, content = self.http.request(uri, "GET", body=" ", headers=headers)
710 uri = urlparse.urljoin(base, "304/test_etag.txt")
712 uri, "GET", headers={"accept-encoding": "identity"}
716 (response, content) = self.http.request(uri, "GET")
718 uri, "GET", headers={"cache-control": "must-revalidate"}
724 cacheDirName, httplib2.safename(httplib2.urlnorm(uri)[-1])
732 (response, content) = self.http.request(uri, "HEAD")
737 uri, "GET", headers={"range": "bytes=0-0"}
744 uri = urlparse.urljoin(base, "reflector/reflector.cgi")
746 uri, "GET", headers={"accept-encoding": "identity"}
751 uri,
752 "GET",
753 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
760 uri,
761 "GET",
762 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
770 uri = urlparse.urljoin(base, "reflector/reflector.cgi")
772 uri, "GET", headers={"accept-encoding": "identity"}
777 uri,
778 "GET",
779 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
786 uri,
787 "GET",
789 "accept-encoding": "identity",
790 "cache-control": "max-age=0",
791 "if-none-match": "fred",
798 # MAP-commented this out because it consistently fails
800 # # Test that end to end headers get overwritten in the cache
801 # uri = urlparse.urljoin(base, "304/end2end.cgi")
802 # (response, content) = self.http.request(uri, "GET")
807 …# (response, content) = self.http.request(uri, "GET", headers = {'Cache-Control': 'max-age=…
816 # by only using the last-modified cache validator.
817 uri = urlparse.urljoin(base, "304/last-modified-only/last-modified-only.txt")
818 (response, content) = self.http.request(uri, "GET")
820 self.assertNotEqual(response["last-modified"], "")
821 (response, content) = self.http.request(uri, "GET")
822 (response, content) = self.http.request(uri, "GET")
829 uri = urlparse.urljoin(base, "307/onestep.asis")
830 (response, content) = self.http.request(uri, "GET")
836 (response, content) = self.http.request(uri, "GET")
845 uri = urlparse.urljoin(base, "410/410.asis")
846 (response, content) = self.http.request(uri, "GET")
850-URI specifies one or more cache entries including a Vary header field, the cache MUST NOT use suc…
854 uri = urlparse.urljoin(base, "vary/accept.asis")
856 uri, "GET", headers={"Accept": "text/plain"}
861 # get the resource again, from the cache since accept header in this
864 uri, "GET", headers={"Accept": "text/plain"}
869 # get the resource again, not from cache since Accept headers does not match
871 uri, "GET", headers={"Accept": "text/html"}
876 # get the resource again, without any Accept header, so again no match
877 (response, content) = self.http.request(uri, "GET")
886 # uri = urlparse.urljoin(base, "vary/no-vary.asis")
887 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
891 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/plain'})
895 # (response, content) = self.http.request(uri, "GET", headers={'Accept': 'text/html'})
900 uri = urlparse.urljoin(base, "vary/accept-double.asis")
902 uri,
903 "GET",
906 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
914 uri,
915 "GET",
918 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
924 uri, "GET", headers={"Accept": "text/plain"}
929 # get the resource again, not from cache, varied headers don't match exact
931 uri, "GET", headers={"Accept-Language": "da"}
938 uri = urlparse.urljoin(base, "vary/unused-header.asis")
940 uri, "GET", headers={"Accept": "text/plain"}
947 uri, "GET", headers={"Accept": "text/plain"}
953 uri = urlparse.urljoin(base, "gzip/final-destination.txt")
954 (response, content) = self.http.request(uri, "HEAD")
956 self.assertNotEqual(int(response["content-length"]), 0)
961 uri = urlparse.urljoin(base, "gzip/final-destination.txt")
962 (response, content) = self.http.request(uri, "GET")
964 self.assertFalse("content-encoding" in response)
965 self.assertTrue("-content-encoding" in response)
967 int(response["content-length"]), len("This is the final destination.\n")
972 uri = urlparse.urljoin(base, "gzip/post.cgi")
973 (response, content) = self.http.request(uri, "POST", body=" ")
975 self.assertFalse("content-encoding" in response)
976 self.assertTrue("-content-encoding" in response)
981 uri = urlparse.urljoin(base, "gzip/failed-compression.asis")
983 (response, content) = self.http.request(uri, "GET")
990 # Re-run the test with out the exceptions
993 (response, content) = self.http.request(uri, "GET")
999 uri = urlparse.urljoin(base, "timeout/timeout.cgi")
1007 (response, content) = self.http.request(uri)
1013 uri = urlparse.urljoin(base, "timeout/timeout.cgi")
1017 (response, content) = http.request(uri)
1028 uri = urlparse.urljoin(base, "deflate/deflated.asis")
1029 (response, content) = self.http.request(uri, "GET")
1031 self.assertFalse("content-encoding" in response)
1033 int(response["content-length"]), len("This is the final destination.")
1041 uri = urlparse.urljoin(base, "deflate/failed-compression.asis")
1043 (response, content) = self.http.request(uri, "GET")
1050 # Re-run the test with out the exceptions
1053 (response, content) = self.http.request(uri, "GET")
1058 # Test that duplicate headers get concatenated via ','
1059 uri = urlparse.urljoin(base, "duplicate-headers/multilink.asis")
1060 (response, content) = self.http.request(uri, "GET")
1069 # Test Cache-Control: no-cache on requests
1070 uri = urlparse.urljoin(base, "304/test_etag.txt")
1072 uri, "GET", headers={"accept-encoding": "identity"}
1076 uri, "GET", headers={"accept-encoding": "identity"}
1082 uri,
1083 "GET",
1084 headers={"accept-encoding": "identity", "Cache-Control": "no-cache"},
1090 # Test Pragma: no-cache on requests
1091 uri = urlparse.urljoin(base, "304/test_etag.txt")
1093 uri, "GET", headers={"accept-encoding": "identity"}
1097 uri, "GET", headers={"accept-encoding": "identity"}
1103 uri, "GET", headers={"accept-encoding": "identity", "Pragma": "no-cache"}
1109 # A no-store request means that the response should not be stored.
1110 uri = urlparse.urljoin(base, "304/test_etag.txt")
1113 uri, "GET", headers={"Cache-Control": "no-store"}
1119 uri, "GET", headers={"Cache-Control": "no-store"}
1125 # A no-store response means that the response should not be stored.
1126 uri = urlparse.urljoin(base, "no-store/no-store.asis")
1128 (response, content) = self.http.request(uri, "GET")
1132 (response, content) = self.http.request(uri, "GET")
1137 # Test that a no-store, no-cache clears the entry from the cache
1139 uri = urlparse.urljoin(base, "304/test_etag.txt")
1141 (response, content) = self.http.request(uri, "GET")
1142 (response, content) = self.http.request(uri, "GET")
1145 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
1148 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
1155 # URI that is cache invalidates that cache.
1156 uri = urlparse.urljoin(base, "304/test_etag.txt")
1158 (response, content) = self.http.request(uri, "GET")
1159 (response, content) = self.http.request(uri, "GET")
1161 (response, content) = self.http.request(uri, "DELETE")
1164 (response, content) = self.http.request(uri, "GET")
1169 uri = urlparse.urljoin(base, "conditional-updates/test.cgi")
1171 (response, content) = self.http.request(uri, "GET")
1174 (response, content) = self.http.request(uri, "GET")
1177 (response, content) = self.http.request(uri, "PUT", body="foo")
1179 (response, content) = self.http.request(uri, "PUT", body="foo")
1184 uri = urlparse.urljoin(base, "conditional-updates/test.cgi")
1186 (response, content) = self.http.request(uri, "GET")
1189 (response, content) = self.http.request(uri, "GET")
1192 (response, content) = self.http.request(uri, "PATCH", body="foo")
1194 (response, content) = self.http.request(uri, "PATCH", body="foo")
1199 uri = urlparse.urljoin(base, "conditional-updates/test.cgi")
1201 (response, content) = self.http.request(uri, "GET")
1204 (response, content) = self.http.request(uri, "GET")
1208 (response, content) = self.http.request(uri, "DELETE")
1213 uri = urlparse.urljoin(base, "conditional-updates/test.cgi")
1215 (response, content) = self.http.request(uri, "GET")
1218 (response, content) = self.http.request(uri, "GET")
1222 uri, "PUT", body="foo", headers={"if-match": "fred"}
1228 uri = urlparse.urljoin(base, "basic/file.txt")
1229 (response, content) = self.http.request(uri, "GET")
1232 uri = urlparse.urljoin(base, "basic/")
1233 (response, content) = self.http.request(uri, "GET")
1237 (response, content) = self.http.request(uri, "GET")
1240 uri = urlparse.urljoin(base, "basic/file.txt")
1241 (response, content) = self.http.request(uri, "GET")
1246 uri = urlparse.urljoin(base, "basic/file.txt")
1247 (response, content) = self.http.request(uri, "GET")
1250 uri = urlparse.urljoin(base, "basic/")
1251 (response, content) = self.http.request(uri, "GET")
1255 (response, content) = self.http.request(uri, "GET")
1258 uri = urlparse.urljoin(base, "basic/file.txt")
1259 (response, content) = self.http.request(uri, "GET")
1264 (response, content) = self.http.request(uri, "GET")
1267 uri = urlparse.urljoin(base, "basic/file.txt")
1268 (response, content) = self.http.request(uri, "GET")
1273 uri = urlparse.urljoin(base, "basic2/file.txt")
1274 (response, content) = self.http.request(uri, "GET")
1277 uri = urlparse.urljoin(base, "basic2/")
1278 (response, content) = self.http.request(uri, "GET")
1282 (response, content) = self.http.request(uri, "GET")
1285 uri = urlparse.urljoin(base, "basic2/file.txt")
1286 (response, content) = self.http.request(uri, "GET")
1292 uri = urlparse.urljoin(base, "basic-nested/")
1293 (response, content) = self.http.request(uri, "GET")
1296 uri = urlparse.urljoin(base, "basic-nested/subdir")
1297 (response, content) = self.http.request(uri, "GET")
1303 uri = urlparse.urljoin(base, "basic-nested/")
1304 (response, content) = self.http.request(uri, "GET")
1307 uri = urlparse.urljoin(base, "basic-nested/subdir")
1308 (response, content) = self.http.request(uri, "GET")
1313 uri = urlparse.urljoin(base, "basic-nested/")
1314 (response, content) = self.http.request(uri, "GET")
1317 uri = urlparse.urljoin(base, "basic-nested/subdir")
1318 (response, content) = self.http.request(uri, "GET")
1323 uri = urlparse.urljoin(base, "digest/")
1324 (response, content) = self.http.request(uri, "GET")
1328 (response, content) = self.http.request(uri, "GET")
1331 uri = urlparse.urljoin(base, "digest/file.txt")
1332 (response, content) = self.http.request(uri, "GET")
1337 uri = urlparse.urljoin(base, "digest/file.txt")
1340 uri, "GET", headers={"cache-control": "no-cache"}
1342 info = httplib2._parse_www_authenticate(response, "authentication-info")
1345 uri, "GET", headers={"cache-control": "no-cache"}
1347 info2 = httplib2._parse_www_authenticate(response, "authentication-info")
1355 uri = urlparse.urljoin(base, "digest-expire/file.txt")
1358 uri, "GET", headers={"cache-control": "no-cache"}
1360 info = httplib2._parse_www_authenticate(response, "authentication-info")
1367 uri, "GET", headers={"cache-control": "no-cache"}
1371 info3 = httplib2._parse_www_authenticate(response, "authentication-info")
1378 uri = urlparse.urljoin(base, "reflector/reflector.cgi")
1379 (response, content) = self.http.request(uri, "GET")
1384 uri = "http://www.google.com/"
1385 (response, content) = self.http.request(uri, "GET")
1389 uri, "GET", headers={"connection": "close"}
1454 # ------------------------------------------------------------------------
1459 # Test that we can parse the Cache-Control header
1462 {"no-cache": 1},
1463 httplib2._parse_cache_control({"cache-control": " no-cache"}),
1466 {"cache-control": " no-cache, max-age = 7200"}
1468 self.assertEqual(cc["no-cache"], 1)
1469 self.assertEqual(cc["max-age"], "7200")
1470 cc = httplib2._parse_cache_control({"cache-control": " , "})
1475 {"cache-control": "Max-age=3600;post-check=1800,pre-check=3600"}
1477 self.assertTrue("max-age" in cc)
1483 h = httplib2._normalize_headers({"Cache-Control": "no-cache", "Other": "Stuff"})
1484 self.assertTrue("cache-control" in h)
1489 # Test that no-cache makes our request TRANSPARENT
1490 response_headers = {"cache-control": "max-age=7200"}
1491 request_headers = {"cache-control": "no-cache"}
1498 # Test that no-cache makes our request TRANSPARENT
1499 response_headers = {"cache-control": "max-age=fred, min-fresh=barney"}
1507 # FRESH, but the no-cache over-rides that.
1512 "cache-control": "no-cache",
1520 # must-revalidate forces STALE
1523 httplib2._entry_disposition({}, {"cache-control": "must-revalidate"}),
1527 # must-revalidate forces STALE
1530 httplib2._entry_disposition({"cache-control": "must-revalidate"}, {}),
1536 "cache-control": "max-age=2",
1550 "cache-control": "max-age=0",
1595 request_headers = {"cache-control": "only-if-cached"}
1604 "cache-control": "max-age=2",
1606 request_headers = {"cache-control": "max-age=0"}
1617 request_headers = {"cache-control": "min-fresh=2"}
1628 request_headers = {"cache-control": "min-fresh=2"}
1641 "www-authenticate": 'Test realm="test realm" , foo=foo ,bar="bar", baz=baz,qux=qux'
1647 # tokens with non-alphanum
1649 {"www-authenticate": 'T*!%#st realm=to*!%#en, to*!%#en="quoted string"'}
1656 {"www-authenticate": 'Test realm="a \\"test\\" realm"'}
1667 res = httplib2._parse_www_authenticate({"www-authenticate": 'Basic realm="me"'})
1672 {"www-authenticate": 'Basic realm="me", algorithm="MD5"'}
1679 {"www-authenticate": 'Basic realm="me", algorithm=MD5'}
1687 {"www-authenticate": 'Basic realm="me",other="fred" '}
1695 {"www-authenticate": 'Basic REAlm="me" '}
1703 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1708 self.assertEqual("auth,auth-int", digest["qop"])
1713 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1718 self.assertEqual("auth,auth-int", digest["qop"])
1725 # Handle an added comma between challenges, which might get thrown in if the challenges were
1726 # originally sent in separate www-authenticate headers.
1729 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1734 self.assertEqual("auth,auth-int", digest["qop"])
1741 # Handle an added comma between challenges, which might get thrown in if the challenges were
1742 # originally sent in separate www-authenticate headers.
1745 …"www-authenticate": 'Digest realm="testrealm@host.com", qop="auth,auth-int", nonce="dcd98b7102dd2f…
1750 self.assertEqual("auth,auth-int", digest["qop"])
1762 …"www-authenticate": 'Digest realm="test-real.m@host.com", qop \t=\t"\tauth,auth-int", nonce="(*)&^…
1766 self.assertEqual("test-real.m@host.com", digest["realm"])
1767 self.assertEqual("\tauth,auth-int", digest["qop"])
1773 …"www-authenticate": 'Digest realm="myrealm", nonce="Ygk86AsKBAA=3516200d37f9a3230352fde99977bd6d47…
1783 … "www-authenticate": 'OAuth "Facebook Platform" "invalid_token" "Invalid OAuth access token."'
1796 "www-authenticate": 'Digest realm="myrealm", '
1805 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1810 ' uri="/projects/httplib2/test/digest/", algorithm=MD5, '
1822 "www-authenticate": 'Digest realm="myrealm", '
1831 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1836 ' uri="/projects/httplib2/test/digest/", algorithm=MD5, '
1849 response["www-authenticate"] = (
1868 response["www-authenticate"] = (
1873 response["authentication-info"] = 'nextnonce="fred"'
1885 "d36e316282959a9ed4c89851497a717f", "2003-12-15T14:43:07Z", "taadtaadpstcsm"
1892 response = {"content-type": "application/atom+xml", "te": "deflate"}
1894 self.assertTrue("content-type" in end2end)
1900 "connection": "content-type",
1901 "content-type": "application/atom+xml",
1905 self.assertTrue("content-type" not in end2end)
1915 response = {"connection": "content-type"}