eturn sub {
my $responder = shift;
my $writer = $responder->('application/json');
$writer->write('{"foo": "bar"}');
$writer->close;
};
}
=h
d for convenience.
=over
=item L<AWS::Lambda>
=item L<AWS::XRay>
=item L<JSON>
=item L<Cpanel::JSON::XS>
=item L<JSON::MaybeXS>
=item L<YAML>
=item L<YAML::Tiny>
=item L<YAML::XS>
=item L<Ne
);
use MIME::Base64;
use JSON::Types;
use Encode;
use Try::Tiny;
use Plack::Middleware::ReverseProxy;
use AWS::Lambda;
use Scalar::Util qw(reftype);
use JSON::XS qw(encode_json);
sub new {
my $pr
ype'} // 'application/octet-stream';
my $isBase64Encoded = $type !~ m(^text/.*|application/(:?json|javascript|xml))i;
if ($isBase64Encoded) {
$content = encode_base64 $content, '';
ponder->("application/vnd.awslambda.http-integration-response");
my $prelude = encode_json($self->_format_response_stream($status, $headers));
$prelude .= "\x00\x00\x00\x00\x00
::Bootstrap;
use 5.026000;
use utf8;
use strict;
use warnings;
use HTTP::Tiny;
use JSON::XS qw/decode_json encode_json/;
use Try::Tiny;
use AWS::Lambda;
use AWS::Lambda::Context;
use AWS::Lambda::Resp
t: $resp->{status} $resp->{reason}";
}
my $h = $resp->{headers};
my $payload = decode_json($resp->{content});
return $payload, AWS::Lambda::Context->new(
deadline_ms =
ion/${request_id}/response";
my $resp = $self->{http}->post($url, {
content => encode_json($response),
});
if (!$resp->{success}) {
die "failed to response of execution: $r
die '$LAMBDA_TASK_ROOT is not found';
my $content_type = $args{content_type} // 'application/json';
my $self = bless +{
response_url => $response_url,
http => $http,
d for convenience.
=over
=item L<AWS::Lambda>
=item L<AWS::XRay>
=item L<JSON>
=item L<Cpanel::JSON::XS>
=item L<JSON::MaybeXS>
=item L<YAML>
=item L<YAML::Tiny>
=item L<YAML::XS>
=item L<Ne
d for convenience.
=over
=item L<AWS::Lambda>
=item L<AWS::XRay>
=item L<JSON>
=item L<Cpanel::JSON::XS>
=item L<JSON::MaybeXS>
=item L<YAML>
=item L<YAML::Tiny>
=item L<YAML::XS>
=item L<Ne
d for convenience.
=over
=item L<AWS::Lambda>
=item L<AWS::XRay>
=item L<JSON>
=item L<Cpanel::JSON::XS>
=item L<JSON::MaybeXS>
=item L<YAML>
=item L<YAML::Tiny>
=item L<YAML::XS>
=item L<Ne