Re: another content negotiation question

It is not necessarily a good way.
But if you must, a better way of doing the first line is
(as in http://www.rkbexplorer.com/blog/?p=11)
    if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/rdf+xml') !== false) {
Now others can address the 303/# issues if they feel like it...
Best
Hugh

On 15/07/2009 15:16, "Christopher St John" <ckstjohn@gmail.com> wrote:

On Wed, Jul 15, 2009 at 8:43 AM, Juan Sequeda<juanfederico@gmail.com> wrote:
> and the objective is not to start another long philosophical thread :P and
> it may be a very dumb question
>
> What are the drawbacks of this simple solution.
>
> in PHP for example:
>
> if($_SERVER['HTTP_ACCEPT'] == "application/rdf+xml" ){
>     header('Content-type: application/rdf+xml');
>     echo "......."
> }
> else{
>     echo "...."
> }
>

Well, if it's not pseudo-code, there's a small bug in that the content-type
can contain a ranked list of acceptable formats, so checking for the
exact string may fail. I assume that really wasn't the point, though :-)

More on topic, I think the scenario would be:

 - Install the "I (Heart) LinkedData" browser extension
 - Surf to http://www.juansequeda.com/id
 - Hit the "I like this" button

How can the extension tell if you're talking about Juan Sequeda,
the person, vs the web page? Maybe I like your page and really
don't like you very much at all. Or the other way 'round.

The "What do HTTP URIs Identify?" writeup seems pretty
exhaustive in going through the options and the various associated
compromises (I suspect this one is 2.2 "Author Definition"[1], but
I could be wrong).

-cks


[1] http://www.w3.org/DesignIssues/HTTP-URI.html#L876

--
Christopher St. John
http://artofsystems.blogspot.com

Received on Wednesday, 15 July 2009 14:34:23 UTC