RE: [RFC] Optional header negotitation

Stefanos Harhalakis wrote:
> There is no indention at all to restrict HTTP! Just
> to provide a way for extending it with headers that
> aren't required everywhere.

It already exists: SEND THE HEADERS.

Right now, go write your script to send "Header-Request:
Timezone". I'll even write one for you in CherryPy 3:

    import cherrypy

    class App:
        
        def index(self):
            tz = cherrypy.request.headers.get("Timezone")
            if tz:
                return "Supplied timezone was: %r" % tz
            else:
                cherrypy.response.headers["Header-Request"] = "Timezone"
                return "No timezone supplied."
        index.exposed = True

    cherrypy.quickstart(App())

Run that and inspect the traffic with a tool like TamperData
for Firefox. Did the "Header-Request" header make it to the
client? (Yes.) Pretend you're a client that understands the
received "Header-Request", and send a "Timezone" header in
your next request. Did it make it to the server? (Yes.) Did
the server understand it? (Yes.) Are we violating the HTTP
spec? (No.) Did we make any changes to the HTTP spec? (No.)
Would there be any difference in the messages if we added
"Header-Request" to the spec? (No.) So why do it? Masochism?


Robert Brewer
fumanchu@aminus.org

Received on Saturday, 18 August 2007 23:53:27 UTC