Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
use JSON;
use HTTP::Request::Common;
use Test::More;
use Test::JsonAPI::Autodoc;
describe 'POST /foo' => sub {
my $req = POST 'http://localhost:5000/foo';
my $json = to_json({
id => 1,
message => 'blah blah',
});
$req->header('Content-Type' => 'application/json');
$req->content($json);
http_ok($req, 200, "get message ok");
};
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.