Lines Matching +full:get +full:- +full:content
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]),
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")
288 response, content = self.http.request(
291 self.assertEqual(response["content-location"], "http://bitworking.org")
292 self.assertEqual(content, "the body")
299 response, content = self.http.request(
319 (response, content) = self.http.request("http://fred.bitworking.org/")
320 self.assertEqual(response["content-type"], "text/plain")
321 self.assertTrue(content.startswith("Unable to find"))
335 (response, content) = self.http.request("http://localhost:7777/")
336 self.assertEqual(response["content-type"], "text/plain")
338 "Connection refused" in content or "actively refused" in content,
339 "Unexpected status %(content)s" % vars(),
348 (response, content) = self.http.request(uri, "GET")
349 d = self.reflector(content)
354 # Test that GET is the default method
356 (response, content) = self.http.request(uri)
357 self.assertEqual(response["x-method"], "GET")
362 for method in ["GET", "PUT", "DELETE", "POST"]:
363 (response, content) = self.http.request(uri, method, body=" ")
364 self.assertEqual(response["x-method"], method)
372 (response, content) = self.http.request(uri, "HEAD")
374 self.assertEqual(content, "")
377 # Test that can do a GET w/o the cache turned on.
380 (response, content) = http.request(uri, "GET")
385 # Test that can do a GET with cache and 'only-if-cached'
387 (response, content) = self.http.request(uri, "GET")
388 (response, content) = self.http.request(
389 uri, "GET", headers={"cache-control": "only-if-cached"}
395 # Test that can do a GET with no cache with 'only-if-cached'
397 (response, content) = self.http.request(
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
410 (response, content) = http.request(
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")
427 (response, content) = self.http.request(
428 uri, "GET", headers={"User-Agent": "fred/1.0"}
431 self.assertTrue(content.startswith("fred/1.0"))
435 uri = urlparse.urljoin(base, "300/with-location-header.asis")
436 (response, content) = self.http.request(uri, "GET")
438 self.assertEqual(content, "This is the final destination.\n")
443 (response, content) = self.http.request(uri, "GET")
445 self.assertEqual(content, "This is the final destination.\n")
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"))
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)
474 self.assertEqual(content, "This is the final destination.\n")
478 (response, content) = self.http.request(uri, "GET")
480 self.assertEqual(response["content-location"], destination)
481 self.assertEqual(content, "This is the final destination.\n")
488 destination = urlparse.urljoin(base, "302/final-destination.txt")
489 (response, content) = self.http.request(uri, "HEAD")
499 destination = urlparse.urljoin(base, "302/final-destination.txt")
500 (response, content) = self.http.request(uri, "GET")
507 destination = urlparse.urljoin(base, "302/final-destination.txt")
508 (response, content) = self.http.request(uri, "GET")
510 self.assertEqual(response["content-location"], destination)
511 self.assertEqual(content, "This is the final destination.\n")
516 (response, content) = self.http.request(uri, "GET")
519 self.assertEqual(response["content-location"], destination)
520 self.assertEqual(content, "This is the final destination.\n")
523 self.assertEqual(response.previous["content-location"], uri)
527 (response, content) = self.http.request(uri, "GET")
530 self.assertEqual(content, "This is the final destination.\n")
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)
556 self.assertTrue(content.startswith("<html>"))
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")
579 self.assertTrue(content.startswith("This is content"))
583 (response, content) = self.http.request("https://code.google.com/apis/", "GET")
589 (response, content) = self.http.request(
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
670 (response, content) = self.http.request(uri, "POST", " ")
672 self.assertEqual(content, "This is the final destination.\n")
676 # Do a follow-up GET on a Location: header
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)
701 # self.assertTrue('authorization' not in content)
704 response, content = self.http.request(uri, "GET", body=" ", headers=headers)
706 # self.assertTrue('authorization' in content)
711 (response, content) = self.http.request(
712 uri, "GET", headers={"accept-encoding": "identity"}
716 (response, content) = self.http.request(uri, "GET")
717 (response, content) = self.http.request(
718 uri, "GET", headers={"cache-control": "must-revalidate"}
724 cacheDirName, httplib2.safename(httplib2.urlnorm(uri)[-1])
732 (response, content) = self.http.request(uri, "HEAD")
736 (response, content) = self.http.request(
737 uri, "GET", headers={"range": "bytes=0-0"}
745 (response, content) = self.http.request(
746 uri, "GET", headers={"accept-encoding": "identity"}
750 (response, content) = self.http.request(
752 "GET",
753 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
755 d = self.reflector(content)
759 (response, content) = self.http.request(
761 "GET",
762 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
764 d = self.reflector(content)
771 (response, content) = self.http.request(
772 uri, "GET", headers={"accept-encoding": "identity"}
776 (response, content) = self.http.request(
778 "GET",
779 headers={"accept-encoding": "identity", "cache-control": "max-age=0"},
781 d = self.reflector(content)
785 (response, content) = self.http.request(
787 "GET",
789 "accept-encoding": "identity",
790 "cache-control": "max-age=0",
791 "if-none-match": "fred",
794 d = self.reflector(content)
798 # MAP-commented this out because it consistently fails
800 # # Test that end to end headers get overwritten in the cache
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")
830 (response, content) = self.http.request(uri, "GET")
832 self.assertEqual(content, "This is the final destination.\n")
836 (response, content) = self.http.request(uri, "GET")
839 self.assertEqual(content, "This is the final destination.\n")
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…
855 (response, content) = self.http.request(
856 uri, "GET", headers={"Accept": "text/plain"}
861 # get the resource again, from the cache since accept header in this
863 (response, content) = self.http.request(
864 uri, "GET", headers={"Accept": "text/plain"}
869 # get the resource again, not from cache since Accept headers does not match
870 (response, content) = self.http.request(
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")
901 (response, content) = self.http.request(
903 "GET",
906 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
913 (response, content) = self.http.request(
915 "GET",
918 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
923 (response, content) = self.http.request(
924 uri, "GET", headers={"Accept": "text/plain"}
929 # get the resource again, not from cache, varied headers don't match exact
930 (response, content) = self.http.request(
931 uri, "GET", headers={"Accept-Language": "da"}
938 uri = urlparse.urljoin(base, "vary/unused-header.asis")
939 (response, content) = self.http.request(
940 uri, "GET", headers={"Accept": "text/plain"}
946 (response, content) = self.http.request(
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)
957 self.assertEqual(content, "")
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")
969 self.assertEqual(content, "This is the final destination.\n")
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")
995 self.assertTrue(response.reason.startswith("Content purported"))
1007 (response, content) = self.http.request(uri)
1010 self.assertTrue(content.startswith("Request Timeout"))
1017 (response, content) = http.request(uri)
1020 self.assertTrue(content.startswith("Request Timeout"))
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.")
1035 self.assertEqual(content, "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")
1055 self.assertTrue(response.reason.startswith("Content purported"))
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")
1062 self.assertEqual(content, "This is content\n")
1069 # Test Cache-Control: no-cache on requests
1071 (response, content) = self.http.request(
1072 uri, "GET", headers={"accept-encoding": "identity"}
1075 (response, content) = self.http.request(
1076 uri, "GET", headers={"accept-encoding": "identity"}
1081 (response, content) = self.http.request(
1083 "GET",
1084 headers={"accept-encoding": "identity", "Cache-Control": "no-cache"},
1090 # Test Pragma: no-cache on requests
1092 (response, content) = self.http.request(
1093 uri, "GET", headers={"accept-encoding": "identity"}
1096 (response, content) = self.http.request(
1097 uri, "GET", headers={"accept-encoding": "identity"}
1102 (response, content) = self.http.request(
1103 uri, "GET", headers={"accept-encoding": "identity", "Pragma": "no-cache"}
1109 # A no-store request means that the response should not be stored.
1112 (response, content) = self.http.request(
1113 uri, "GET", headers={"Cache-Control": "no-store"}
1118 (response, content) = self.http.request(
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
1141 (response, content) = self.http.request(uri, "GET")
1142 (response, content) = self.http.request(uri, "GET")
1144 (response, content) = self.http.request(
1145 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
1147 (response, content) = self.http.request(
1148 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
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")
1221 (response, content) = self.http.request(
1222 uri, "PUT", body="foo", headers={"if-match": "fred"}
1229 (response, content) = self.http.request(uri, "GET")
1233 (response, content) = self.http.request(uri, "GET")
1237 (response, content) = self.http.request(uri, "GET")
1241 (response, content) = self.http.request(uri, "GET")
1247 (response, content) = self.http.request(uri, "GET")
1251 (response, content) = self.http.request(uri, "GET")
1255 (response, content) = self.http.request(uri, "GET")
1259 (response, content) = self.http.request(uri, "GET")
1264 (response, content) = self.http.request(uri, "GET")
1268 (response, content) = self.http.request(uri, "GET")
1274 (response, content) = self.http.request(uri, "GET")
1278 (response, content) = self.http.request(uri, "GET")
1282 (response, content) = self.http.request(uri, "GET")
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")
1324 (response, content) = self.http.request(uri, "GET")
1328 (response, content) = self.http.request(uri, "GET")
1332 (response, content) = self.http.request(uri, "GET")
1339 (response, content) = self.http.request(
1340 uri, "GET", headers={"cache-control": "no-cache"}
1342 info = httplib2._parse_www_authenticate(response, "authentication-info")
1344 (response, content) = self.http.request(
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")
1357 (response, content) = self.http.request(
1358 uri, "GET", headers={"cache-control": "no-cache"}
1360 info = httplib2._parse_www_authenticate(response, "authentication-info")
1366 (response, content) = self.http.request(
1367 uri, "GET", headers={"cache-control": "no-cache"}
1371 info3 = httplib2._parse_www_authenticate(response, "authentication-info")
1374 def reflector(self, content): argument
1375 return dict([tuple(x.split("=", 1)) for x in content.strip().split("\n")])
1379 (response, content) = self.http.request(uri, "GET")
1380 d = self.reflector(content)
1385 (response, content) = self.http.request(uri, "GET")
1388 (response, content) = self.http.request(
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", '
1800 content = ""
1803 credentials, host, request_uri, headers, response, content, None
1805 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1822 "www-authenticate": 'Digest realm="myrealm", '
1826 content = ""
1829 credentials, host, request_uri, headers, response, content, None
1831 d.request("GET", request_uri, headers, content, cnonce="33033375ec278a46")
1849 response["www-authenticate"] = (
1855 content = ""
1857 credentials, host, request_uri, headers, response, content, None
1860 self.assertTrue(d.response(response, content))
1868 response["www-authenticate"] = (
1873 response["authentication-info"] = 'nextnonce="fred"'
1874 content = ""
1876 credentials, host, request_uri, headers, response, content, None
1879 self.assertFalse(d.response(response, content))
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"}