07 September 2011
Facebook::Graph doesn't provide DELETE method by default. but we can do it for sure. below is one sample code:

use Facebook::Graph;
use LWP::UserAgent;
use HTTP::Request::Common ();

my $fb = Facebook::Graph->new(
    app_id     => $app_id,
    secret     => $app_sec,
    postback   => $postback_url,
);

my $uri = $fb->query->find($post_id)->uri_as_string;
my $req = HTTP::Request::Common::DELETE($uri);
$req->header('Content-Length', 0);
my $response = LWP::UserAgent->new->request($req);

Note we have to set Content-Length to 0. or we'll get 400 Bad Request.

Thanks


blog comments powered by Disqus