-
-
Save anquegi/1927155e20c20b846b9d53d105259523 to your computer and use it in GitHub Desktop.
Revisions
-
chsanch created this gist
Jun 5, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ sub get-term-id ( Cro::HTTP::Client $client, Str $value ) { my $result; try { my $resp = await $client.get: 'terms?short_form=eq.' ~ $value; # headers => [ # Cro::HTTP::Header.new( # name => 'Accept', # value => 'application/vnd.pgrst.object+json' # ) # ]; $result = await $resp.body; CATCH { when X::Cro::HTTP::Error { say 'Got an error: ' ~ .response.status; } } } return $result; }