diff options
Diffstat (limited to 'eg')
-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"; |