@@ -41,42 +41,41 @@ void main() {
41
41
client.close ();
42
42
});
43
43
44
- test ('#send a POST with no-cache type' , () async {
44
+ test ('#send a GET with no-cache type' , () async {
45
45
var client = BrowserClient (cacheMode: CacheMode .noCache);
46
46
47
- await client.post (url);
48
- var response = await client.post (url);
47
+ await client.get (url);
48
+ var response = await client.get (url);
49
49
client.close ();
50
50
expect (
51
51
response.body,
52
52
parse (anyOf (containsPair ('numOfRequests' , 2 ),
53
53
containsPair ('cache-control' , ['max-age=0' ]))));
54
54
});
55
55
56
- test ('#send a POST with no-store type' , () async {
56
+ test ('#send a GET with no-store type' , () async {
57
57
var client = BrowserClient (cacheMode: CacheMode .noStore);
58
58
59
- await client.post (url);
60
- var response = await client.post (url);
59
+ await client.get (url);
60
+ var response = await client.get (url);
61
61
client.close ();
62
62
expect (response.body, parse (allOf (containsPair ('numOfRequests' , 2 ))));
63
63
});
64
64
65
- test ('#send a POST with force-store type' , () async {
65
+ test ('#send a GET with force-store type' , () async {
66
66
var client = BrowserClient (cacheMode: CacheMode .forceCache);
67
67
68
- await client.post (url);
69
- var response = await client.post (url);
68
+ await client.get (url);
69
+ var response = await client.get (url);
70
70
client.close ();
71
- expect (response.body, parse (allOf (containsPair ('numOfRequests' , 2 ))));
71
+ expect (response.body, parse (allOf (containsPair ('numOfRequests' , 1 ))));
72
72
});
73
73
74
74
test ('#send a StreamedRequest with only-if-cached type' , () {
75
75
var client = BrowserClient (cacheMode: CacheMode .onlyIfCached);
76
- var request = http.StreamedRequest ('POST ' , url);
76
+ var request = http.StreamedRequest ('GET ' , url);
77
77
78
78
expectLater (client.send (request), throwsA (isA <ClientException >()));
79
- request.sink.add ('{"hello": "world"}' .codeUnits);
80
79
unawaited (request.sink.close ());
81
80
82
81
client.close ();
0 commit comments