Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- get 'deviceadmin' => sub {
- my $c = shift;
- my $ua = Mojo::UserAgent->new;
- app->log->debug('IOLOOP: ' . (Mojo::IOLoop->is_running ? 1 : 0));
- my $headers = { Authorization => 'key=A' };
- my $payload = encode_json { android => {alert => 'alerthere', badge => '+2', title => 'titlehere', tickerText => 'foo bar long crap here blah blah blah' },
- token => 1234,
- msgtype => 1};
- my $tx = $ua->build_tx(POST => 'https://android.googleapis.com/gcm/send' => $headers =>
- form => { registration_id => 'AP',
- collapse_key => 'foo',
- 'data.payload' => $payload } );
- $tx = $ua->start($tx => sub{});
- Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
- }; # deviceadmin
- [Sat Mar 21 03:32:06 2015] [debug] GET "/app/deviceadmin"
- [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
- [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
- [Sat Mar 21 03:32:06 2015] [debug] Routing to a callback
- [Sat Mar 21 03:32:06 2015] [debug] IOLOOP: 1
- -- Non-blocking request (https://android.googleapis.com/gcm/send)
- -- Connect 9067e56496aa7cf30f0caa4f900060ec (https://android.googleapis.com:443)
- [Sat Mar 21 03:32:06 2015] [debug] Rendering template "deviceadmin.html.ep" from DATA section
- [Sat Mar 21 03:32:06 2015] [debug] Rendering template "layouts/bootstrap.html.ep" from DATA section
- [Sat Mar 21 03:32:06 2015] [debug] 200 OK (0.007120s, 140.449/s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement