02 April 2008

MySpace, and Content-Type Negotiation in REST using WCF

Hah!   followup on a hot topic. I posted earlier on content-type negotiation in REST with WCF.  

My buddy Vittorio wrote about MySpace's kiss-and-tell episode at Mix08.  MySpace has exposed a REST interface for the MySpace resources - see http://developer.myspace.com for more info - and the designers talked about their experience at the MIX08 conference this month. Cool!

But here's the thing - MySpace wanted to support different content types for the same resource.  Rather than employ Accept headers for content-type negotiation, MySpace elected to use a different URL for a different content-type, on the same resource.  So if you want a representation in JSON, then you tickle a URL that ends in .json.  If you want plain old XML, then you use a URL that ends in .xml. 

That's one vote, in favor of my viewpoint.   Hah!

This doesn't settle anything, of course, except that, I'm right again.

Also, one more API to be added to Hanselman's list.

 

Filed under: , , , ,
 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# jonflanders said:

According to the Ruby/Richardson book - it should be both, a representation should have its own URI - and be retrievable via a Base URI with an Accept request header.

My guess is that MySpace choose URI is because WCF enables that easily - and doesn't easily enable the other.

02 April 08 at 3:52 PM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker