r;
use strict;
use AnyEvent;
use Carp ();
use Encode ();
use Any::Moose;
use MIME::Base64 ();
use JSON;
use Tatsumaki::Error;
has application => (is => 'rw', isa => 'Tatsumaki::Application');
has con
=> (is => 'rw', isa => 'Str', lazy => 1, lazy_build => 1);
has json => (is => 'rw', isa => 'JSON', lazy => 1, default => sub { JSON->new->utf8 });
has binary => (is => 'rw', isa => 'Bool');
ha
$_[0]) {
if ($self->mxhr) {
my $json = $self->json->encode($_[0]);
return "Content-Type: application/json\n\n$json\n--" . $self->mxhr_boundary. "\n";
} else {