Re: another content negotiation question

On Wed, Jul 15, 2009 at 4:06 PM, Ted Thibodeau Jr <tthibodeau@openlinksw.com
> wrote:

> Juan --
>
> On Jul 15, 2009, at 09:43 AM, Juan Sequeda 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 "...."
>> }
>>
>> I did this at http://www.juansequeda.com/id/
>>
>> However, there is a difference when it is /id and /id/. When I dereference
>> http://www.juansequeda.com/id I get a 301 (Moved Permanently) but with
>> http://www.juansequeda.com/id/ I get 200 (and everything validated by
>> Vapour!).
>>
>> As this ever been discussed? I can obviously see the drawback of having
>> /id/ vs /id .
>>
>
>
>
> I think that's not a content negotiation issue, but rather a resource
> specification issue.


I guess that is a good way to put it.. but it "appears" to be a content
negotiation issue.

>
>
> /id/ is a directory, and you're actually asking for the Directory Index.
> The specific resource will typically be something like /id/index.html,
> and be determined by the server.


Yup. In this case, it is an index.php file

>
>
> /id is a specific resource -- though some servers may rewrite it to
> /id/ if there is such a directory and no such resource -- as yours
> appears to be doing.


The server does rewrite it if you put it in your browser. But if I do for
example

curl -v -H "Accept: application/rdf+xml" http://www.juansequeda.com/id/
curl -v -H "Accept: text/html" http://www.juansequeda.com/id/

I get RDF and HTML respectively back. That is why I say it acts like content
negotiation. However if I do

curl -v -H "Accept: application/rdf+xml" http://www.juansequeda.com/id

I get the 301 back.


I'm just wondering if this is something that is frown upon or something? I
have always seen discussion about hash uri and 303, but not about this
approach.


>
> Or have I misunderstood?
>
> Ted
>
>
>
> --
> A: Yes.                      http://www.guckes.net/faq/attribution.html
> | Q: Are you sure?
> | | A: Because it reverses the logical flow of conversation.
> | | | Q: Why is top posting frowned upon?
>
> Ted Thibodeau, Jr.           //               voice +1-781-273-0900 x32
> Evangelism & Support         //        mailto:tthibodeau@openlinksw.com
> OpenLink Software, Inc.      //              http://www.openlinksw.com/
>                                 http://www.openlinksw.com/weblogs/uda/
> OpenLink Blogs              http://www.openlinksw.com/weblogs/virtuoso/
>                               http://www.openlinksw.com/blog/~kidehen/<http://www.openlinksw.com/blog/%7Ekidehen/>
>    Universal Data Access and Virtual Database Technology Providers
>
>
>
>

Received on Wednesday, 15 July 2009 14:16:12 UTC