@@ -19,6 +19,9 @@ my $app = route {
1919 http 'CUSTOM', -> {
2020 content 'text/plain', 'CUSTOM';
2121 }
22+ http <GET CUSTOM>, -> "list" {
23+ content 'text/plain', 'GET or CUSTOM';
24+ }
2225}
2326
2427{
@@ -42,6 +45,16 @@ my $app = route {
4245 ok $resp ~~ Cro::HTTP::Response, 'CUSTOM using http method works';
4346 is await($resp.body-text), 'CUSTOM', 'Body text is correct';
4447 }
48+
49+ given await $c.get("$base/list") -> $resp {
50+ ok $resp ~~ Cro::HTTP::Response, 'GET using http method works';
51+ is await($resp.body-text), 'GET or CUSTOM', 'Body text is correct';
52+ }
53+
54+ given await $c.request('CUSTOM', "$base/list") -> $resp {
55+ ok $resp ~~ Cro::HTTP::Response, 'CUSTOM using http method works';
56+ is await($resp.body-text), 'GET or CUSTOM', 'Body text is correct';
57+ }
4558}
4659
4760if supports-alpn() {
@@ -67,6 +80,16 @@ if supports-alpn() {
6780 ok $resp ~~ Cro::HTTP::Response, 'CUSTOM using http method works';
6881 is await($resp.body-text), 'CUSTOM', 'Body text is correct';
6982 }
83+
84+ given await $c.get("$base/list", :%ca) -> $resp {
85+ ok $resp ~~ Cro::HTTP::Response, 'GET using http method works';
86+ is await($resp.body-text), 'GET or CUSTOM', 'Body text is correct';
87+ }
88+
89+ given await $c.request('CUSTOM', "$base/list", :%ca) -> $resp {
90+ ok $resp ~~ Cro::HTTP::Response, 'CUSTOM using http method works';
91+ is await($resp.body-text), 'GET or CUSTOM', 'Body text is correct';
92+ }
7093}
7194
7295done-testing;
0 commit comments