The Code
The code for deleting your application looks much the same as the code for creating one . This code deletes the push application that was created in that hack that sent the latest links from my del.icio.us page .
use strict;
use LWP::UserAgent;
use HTTP::Request;
my $MDS = "localhost";
my $PORT = "8080";
my $PIN = '2100000A';
my %headers_to_send = (
'X-RIM-Push-Type' => "Browser-Channel-Delete",
'X-RIM-Push-Channel-ID' => "daves-delicious",
);
my $mds_url =
"http://$MDS:$PORT/push?DESTINATION=$PIN&PORT=7874&REQUESTURI=/";
my $request = HTTP::Request->new;
$request->method('GET');
$request->uri($mds_url);
foreach my $header (keys %headers_to_send) {
my $value = $headers_to_send{$header};
$request->header($header,$value);
}
my $content = "this string can be anything";
$request->content($content);
my $browser = LWP::UserAgent->new;
$browser->agent("My Test Push Application");
my $response = $browser->request($request);
if ($response->is_success) {
print "Delete was successful. Sent to $PIN.\n";
} else {
print "There was a problem. Code was: ",$response->code,"\n";
}