From 585ce5b679406ffe8644b23e3a267d7af8e3a5de Mon Sep 17 00:00:00 2001 From: franck cuny Date: Thu, 23 Sep 2010 22:09:36 +0200 Subject: initial import --- eg/post_hook.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 eg/post_hook.t (limited to 'eg') diff --git a/eg/post_hook.t b/eg/post_hook.t new file mode 100644 index 0000000..f0d766e --- /dev/null +++ b/eg/post_hook.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use 5.010; +use LWP::UserAgent; +use HTTP::Request::Common; +use YAML::Syck; +use JSON; + +my $content = LoadFile('t/data/test.yaml'); +my $payload = JSON::encode_json($content); + +my $url = "http://localhost:5000/hook/"; + +my $req = POST $url, [payload => $payload]; + +my $ua = LWP::UserAgent->new(); +my $res = $ua->request($req); +$res->is_success ? say "ok" : say "not ok"; -- cgit 1.4.1