URI dereferencing with Django / HTTP Content Negotiation
I've been building a Django app that essentially allows for the dereferencing of URIs that follow the USGIN Scheme. The engine also does some content-negotiation by reading HTTP GET accept-headers and responding with an appropriate file located somewhere on the internet. I had never even heard about content negotiation before embarking on this, and here are a few things that I learned:
In Firefox, if your html page has an IMG tag, lets say:
<img src="http://resources.usgin.org/uri-gin/usgin/dataset/" />
... when you load the page Firefox makes the request with an accept-header that reads: "image/png,image/*;q=0.8,*/*;q=0.5". Since my URI is setup with an accept-mapping to match image/jpeg, the image comes through.
Load the same page in Chrome or Internet Explorer and the accept-header reads: "*/*". No image loads, because the server tries to give it the text/html response.
Also, here's a good read if you are wondering what the heck content-negotiation is: http://www.w3.org/QA/2006/02/content_negotiation.html