2.xml" -H "X-HTTP-Method-Override:???
PUT" -H "Content-Type: application/atom+xml " -H "Authorization: GoogleLogin???
auth=[AUTH-TOKEN]" http://www.blogger.com/feeds/{blogID}/posts/default/{postID}
Deleting a Blog Entry
You can use the HTTP DELETE method to delete an entry but send that request to the URL of
the entry itself. As a curl invocation, the request looks like this:
curl -X DELETE -v -H "Content-Type: application/atom+xml " -H "Authorization:???
GoogleLogin auth=[AUTH-TOKEN]"???
http://www.blogger.com/feeds/{blogID}/posts/default/{postID}
As with updating a blog entry, you can tunnel a DELETE request through an HTTP POST
request using an ???X-HTTP-Method-Override: DELETE??? request header.
Using the Blogger API As a Uniform Interface Based on
HTTPMethods
Now that you have seen how to use the Blogger API to retrieve feeds of blogs and blog entries,
create new blog entries, update an entry, and delete an entry, you should notice how all these
actions are performed while hewing closely to HTTP methods as they are actually defined in
the HTTP specification. This pattern of using the HTTP methods as the fundamental methods
of the API, in fact, repeats itself in all the APIs that are based on the Atom Publishing Protocol
and therefore GData. Thus, the uniform interface of GData is the full collection of standard
HTTP methods.
CHAPTER 7 ?– EXPLORING OTHER WEB APIS 203
Summary
In this chapter, I discussed how to consume web APIs that use the XML-RPC and SOAP/WSDL
protocols.
Pages:
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353