• Home
  • Raw
  • Download

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

12     # Test that can do a GET with cache and 'only-if-cached'
15 http.request(uri, "GET")
16 response, content = http.request(
17 uri, "GET", headers={"cache-control": "only-if-cached"}
24 # Test that can do a GET with no cache with 'only-if-cached'
27 response, content = http.request(
28 uri, "GET", headers={"cache-control": "only-if-cached"}
35 # Test that can do a GET with no cache with 'only-if-cached'
37 # that responds to the 'only-if-cached', so this
41 response, content = http.request(
42 uri, "GET", headers={"cache-control": "only-if-cached"}
54 # uri = urllib.parse.urljoin(base, "vary/no-vary.asis")
55 # response, content = http.request(uri, 'GET', headers={'Accept': 'text/plain'})
59 # response, content = http.request(uri, 'GET', headers={'Accept': 'text/plain'})
63 # response, content = http.request(uri, 'GET', headers={'Accept': 'text/html'})
70 # See https://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html.
73 headers={"vary": "Accept", "cache-control": "max-age=300"}, add_date=True
76 response, content = http.request(uri, "GET", headers={"accept": "text/plain"})
80 # get the resource again, from the cache since accept header in this
82 response, content = http.request(uri, "GET", headers={"Accept": "text/plain"})
86 # get the resource again, not from cache since Accept headers does not match
87 response, content = http.request(uri, "GET", headers={"Accept": "text/html"})
91 # get the resource again, without any Accept header, so again no match
92 response, content = http.request(uri, "GET")
100 headers={"vary": "Accept, Accept-Language", "cache-control": "max-age=300"},
104 response, content = http.request(
106 "GET",
109 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
116 response, content = http.request(
118 "GET",
121 "Accept-Language": "da, en-gb;q=0.8, en;q=0.7",
126 response, content = http.request(uri, "GET", headers={"Accept": "text/plain"})
130 # get the resource again, not from cache, varied headers don't match exact
131 response, content = http.request(uri, "GET", headers={"Accept-Language": "da"})
139 headers={"vary": "X-No-Such-Header", "cache-control": "max-age=300"},
144 response, content = http.request(uri, "GET", headers={"Accept": "text/plain"})
149 response, content = http.request(uri, "GET", headers={"Accept": "text/plain"})
154 # Test Cache-Control: no-cache on requests
159 headers={"cache-control": "max-age=300"},
162 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
166 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
171 "GET",
172 headers={"accept-encoding": "identity", "Cache-Control": "no-cache"},
179 # Test Pragma: no-cache on requests
184 headers={"cache-control": "max-age=300"},
187 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
189 response, _ = http.request(uri, "GET", headers={"accept-encoding": "identity"})
193 uri, "GET", headers={"accept-encoding": "identity", "Pragma": "no-cache"}
200 # A no-store request means that the response should not be stored.
205 headers={"cache-control": "max-age=300"},
208 response, _ = http.request(uri, "GET", headers={"Cache-Control": "no-store"})
211 response, _ = http.request(uri, "GET", headers={"Cache-Control": "no-store"})
217 # A no-store response means that the response should not be stored.
222 headers={"cache-control": "max-age=300, no-store"},
225 response, _ = http.request(uri, "GET")
228 response, _ = http.request(uri, "GET")
234 # Test that a no-store, no-cache clears the entry from the cache
240 headers={"cache-control": "max-age=300"},
243 response, _ = http.request(uri, "GET")
244 response, _ = http.request(uri, "GET")
247 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
252 uri, "GET", headers={"Cache-Control": "no-store, no-cache"}
267 add_date=True, add_etag=True, headers={"cache-control": "max-age=300"}
271 response, _ = http.request(uri, "GET")
272 response, _ = http.request(uri, "GET")
277 response, _ = http.request(uri, "GET")
283 if request.method == "GET":
284 if request.headers.get("if-none-match", "") == "12345":
287 add_date=True, headers={"etag": "12345", "cache-control": "max-age=300"}
290 if request.headers.get("if-match", "") == "12345":
301 response, _ = http.request(uri, "GET")
304 response, _ = http.request(uri, "GET")
317 response, _ = http.request(uri, "GET")
320 response, _ = http.request(uri, "GET")
332 response, content = http.request(uri, "GET")
335 response, content = http.request(uri, "GET")
338 response, content = http.request(
339 uri, "PUT", body=b"foo", headers={"if-match": "fred"}
348 ({"cache-control": " no-cache"}, {"no-cache": 1}),
350 {"cache-control": " no-store, max-age = 7200"},
351 {"no-store": 1, "max-age": "7200"},
353 ({"cache-control": " , "}, {"": 1}), # FIXME
355 {"cache-control": "Max-age=3600;post-check=1800,pre-check=3600"},
356 {"max-age": "3600;post-check=1800", "pre-check": "3600"},
368 h = httplib2._normalize_headers({"Cache-Control": "no-cache", "Other": "Stuff"})
369 assert "cache-control" in h
378 {"cache-control": "no-cache"},
379 {"cache-control": "max-age=7200"},
382 ({}, {"cache-control": "max-age=fred, min-fresh=barney"}, "STALE"),
386 {"date": "{now}", "expires": "{now+3}", "cache-control": "no-cache"},
389 ({"cache-control": "must-revalidate"}, {}, "STALE"),
390 ({}, {"cache-control": "must-revalidate"}, "STALE"),
391 ({}, {"date": "{now}", "cache-control": "max-age=0"}, "STALE"),
392 ({"cache-control": "only-if-cached"}, {}, "FRESH"),
396 {"cache-control": "max-age=0"},
397 {"date": "{now}", "cache-control": "max-age=2"},
401 {"cache-control": "min-fresh=2"},
406 {"cache-control": "min-fresh=2"},
415 nowre = re.compile(r"{now([\+\-]\d+)?}")
433 "cache-control": "max-age=2",