diff options
author | franck cuny <franck@lumberjaph.net> | 2010-09-23 22:09:36 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-09-23 22:09:36 +0200 |
commit | 585ce5b679406ffe8644b23e3a267d7af8e3a5de (patch) | |
tree | 27dff9a966b9c265e929330b48314f1c38d48428 /eg/post_hook.t | |
parent | ignore logs (diff) | |
download | jitterbug-585ce5b679406ffe8644b23e3a267d7af8e3a5de.tar.gz |
initial import
Diffstat (limited to '')
-rw-r--r-- | eg/post_hook.t | 18 |
1 files changed, 18 insertions, 0 deletions
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"; |