Help language development. Donate to The Perl Foundation

HTTP::Tinyish cpan:SKAJI last updated on 2021-02-14
[![Actions Status](](


HTTP::Tinyish - Raku port of HTTP::Tinyish


Synchronous way:

my $http = => "Mozilla/4.0");

my %res = $http.get("");
warn %res<status>;

  headers => { "Content-Type" => "application/x-www-form-urlencoded" },
  content => "foo=bar&baz=quux",


Asynchronous way:

my $http =;

my @url = <

my @promise = -> $url {
  $http.get($url).then: -> $promise {
    my %res = $promise.result;
    say "Done %res<status> %res<url>";

my @res = await @promise;


HTTP::Tinyish is a Raku port of []( Currently only support curl.

Str VS Buf

Raku distinguishes Str from Buf. HTTP::Tinyish handles data as Str by default (that is, encode/decode utf-8 if needed by default). If you want to handle data as Buf, please follow the instruction below.

If you want to send Buf content, just specify Buf in content:

my $binary-data = "file.bin".IO.slurp(:bin);
  content => $binary-data,

If you want to recieve http content as Buf, then call request/get/post/... method with `bin => True `:

my %res = $http.get("", bin => True);
does-ok %res<content>, Buf; # pass

And decode `%res<content> ` by yourself if you want.


Copyright 2015 Shoichi Kaji <[email protected]>

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

Original perl5 HTTP::Tinyish COPYRIGHT and LICENSE:

    Tatsuhiko Miyagawa, 2015-

    This module is licensed under the same terms as Perl itself.