I have a simple problem. I want to delete all app request sent via my Facebook application. Facebook documentation gives following code to do that:
DELETE https://graph.facebook.com/[<request_id>_<user_id>]?access_token=[USER or APP ACCESS TOKEN]
My problem is how to make HTTP DELETE request in my rails application?
I am using following code to make HTTP GET request:
client = HTTPClient.new
@data = client.get_content(URI.parse(
URI.encode("https://graph.facebook.com/RequestID?access_token=AccessToken")
))
Have a look at
HTTPClient#deletemethod. I believe that’s all you need. That should be smth likeBtw, why do you need that
URI.parseandURI.encodestuff in you example?And as you’re dealing with Facebook I’d suggest looking at rest-graph gem. It’s a pretty good tool for dealing with Facebook Graph API.