Created
November 30, 2022 17:07
-
-
Save JJ/e5e6c9789e6dd2c2221744339c0e0bc2 to your computer and use it in GitHub Desktop.
Reading CSV, server-side
This file contains 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 characters
sub server-login() { | |
my Lock \l .= new; | |
our $cro; | |
l.protect: { | |
my $c = Cro::HTTP::Client.new: | |
base-uri => SERVER-URL, | |
content-type => JSON, | |
user-agent => 'honking/2022.2.1', | |
timeout => %( | |
connection => 240, | |
headers => 480, | |
), | |
cookie-jar => Cro::HTTP::Client::CookieJar.new, | |
; | |
await $c.post: "{SERVER-URI}/{SESSION-PATH}", body => CREDENTIALS | |
$cro = $c | |
} | |
$cro | |
} | |
sub server-post($data) { | |
our $cro; | |
my $r = await $cro.post: "{SERVER-URI}/{DATA-PATH}", body => $data; | |
await $r.body | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment