0

I'm trying to delete a blog post on blogger.com using Blogger API via Prototype Javascript library. Here's my code:

var request = new Ajax.Request(
    'http://www.blogger.com/feeds/'+remoteBlogId+'/posts/default/'+postId
    {
        method:'DELETE',
        requestHeaders:['Authorization', 'GoogleLogin auth='+authKey],
        on200:function(){/*onSuccess*/},
        onFailure:function(){/*onFailure*/}
    }
);

As far as I can see from API description, everything's alright, but when I run this, it fires onSuccess function, but doesn't delete the entry on the server.

I guess that Prototype doesn't work well with HTTP methods other than GET and POST (here's the ticket describing similar problem though proposed patch didn't work for me)

Any help is appreciated!

Rob W
  • 341,306
  • 83
  • 791
  • 678
Mikhail
  • 621
  • 3
  • 17
  • UPD: I really don't need cross-browser availability, I need only support for webkit-based browser. Does anyone know something about it? – Mikhail Mar 22 '10 at 07:50

2 Answers2

0

You could use jQuery - here's an article that shows how to use REST methods in jQuery Ajax. jQuery is much more known framework than Prototype.

Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
0

Not all browsers support PUT and DELETE - this is regardless of what JS library you're using. See this topic: Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

Community
  • 1
  • 1
Peter
  • 6,354
  • 1
  • 31
  • 29