Skip to content

Instantly share code, notes, and snippets.

@moznion
Last active December 27, 2015 06:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moznion/7279141 to your computer and use it in GitHub Desktop.
Save moznion/7279141 to your computer and use it in GitHub Desktop.
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