Riap
view release on metacpan or search on metacpan
lib/Riap.pod view on Meta::CPAN
=item * B<res_part_len> => int
Will be passed to function as special argument C<-res_part_len> to request
partial result.
=item * B<stream_arg> => bool
Optional. If set to true, then will provide a filehandle or an iterable object
as argument value for the function, where the function can read data from. And
will also send special argument C<< -arg_stream => 1 >> to function. Note that
the function must have exactly a single argument that has its C<streaming>
property set to true. Otherwise, server MUST send 501 (unimplemented) response.
=back
=head2 Action: B<complete_arg_val>
Complete function argument value, a la Bash tab completion where you have a
semicompleted word and request possible values started by that word. Additional
Riap request keys include:
lib/Riap/HTTP.pod view on Meta::CPAN
{
"filename":"myvideo.mp4",
"data":"...data from upload...",
"-arg_len":124905,
"-arg_part_start":409,
"-arg_part_len":124496
}
Or, if HTTP request header C<Transfer-Encoding: chunked> is present, then server
will assume streaming input. Function eill
Otherwise, if there is no partial content upload, the server MUST also accept
C<args> from HTTP request body. The server MUST accept at least body of type
C<application/json>, but it can accept other types. The server MUST not
interpret C<application/x-www-form-urlencoded> for this purpose (and interpret
it as a normal web form). Server MUST return response 400 if document type is
not recognized.
The server can also accept Riap request keys or function arguments using other
means. For example, L<Plack::Middleware::PeriAHS::ParseRequest>, from Perl
lib/Riap/HTTP.pod view on Meta::CPAN
To request partial result, you can send HTTP headers C<Range> which will be
translated to C<res_part_start> and C<res_part_len> Riap request keys, which
will then be passed to function as C<-res_part_start> and C<-res_part_len>.
Normal HTTP response (without any C<Range> HTTP response headers) will be
returned. If function supports partial result, the enveloped response contained
in the HTTP response will be something like C<< [206, "Partial content",
"...partial data...", {"riap.v":1.2, "len":TL, "part_start":S, "part_len":L}] >>
where the numbers represented by S, L will correspond to the range requested.
=head2 How to do Rinci's streaming input on Riap::HTTP?
Client can send a chunked transfer. See L</"Parsing Riap request from HTTP
request"> for more details.
=head2 How to do Rinci's streaming output on Riap::HTTP?
Send can send a chunked transfer. See L</"OUTPUT STREAM"> for more details.
=head1 SEE ALSO
L<Riap::Simple>
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/Riap>.
( run in 0.257 second using v1.01-cache-2.11-cpan-4d50c553e7e )