You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2010/03/19 00:54:11 UTC

Standard HTTP headers in HTTP Query by Pivot

Hi to all,
at work I'm doing some stuff related to the User-Agent Header in HTTP
Queries, for statistical purposes (on the server) and for other
reasons (the server could see what to do depending on the type of
client that generates the query), and it seems that currently we don't
have a default for this in Pivot ...
So, if this is right, what do you think on add something like this as
header line in Pivot HTTP query:

User-Agent: Apache-Pivot/1.5

and verify if add also a (separated with one or more space) Java
Runtime 1.6.0_18 (if available, depending on the restrictions of the
Security Manager), and maybe also if 32 bit or 64 bit ... all data
that could be useful on server-side. Ah important, also the O.S. of
the client could be useful too.
Or there could exist a method to set this header field, but if not
specified one of the previous values could be used.

Comments ?
This should be a small fix, so maybe I could do it for the 1.5 release ...


Note:
probably also other headers could be useful to set, like:
Accept with the mime type of the current serializer,
Accept-Charset with the charset of the current serializer,
Accept-Encoding if we are able to handle compressed answers ... anyone
has tried with an xml or json gzipped by the server ?
Accept-Language with the user locale (if not english) and en as last,
Referer with the current URL in case of Applets,
etc ... but this could require additional discussions, and probably
not for the 1.5 release.
Or could be set when desired with some utility methods.

Some references:
http://en.wikipedia.org/wiki/List_of_HTTP_headers
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html


Bye,
Sandro

Re: Standard HTTP headers in HTTP Query by Pivot

Posted by Greg Brown <gk...@mac.com>.
> So, if this is right, what do you think on add something like this as
> header line in Pivot HTTP query:
> User-Agent: Apache-Pivot/1.5

> probably also other headers could be useful to set, like:
> Accept with the mime type of the current serializer,
> Accept-Charset with the charset of the current serializer,
> Accept-Encoding if we are able to handle compressed answers ... anyone
> has tried with an xml or json gzipped by the server ?
> Accept-Language with the user locale (if not english) and en as last,
> Referer with the current URL in case of Applets,
> etc ... but this could require additional discussions, and probably
> not for the 1.5 release.
> Or could be set when desired with some utility methods.


I think this is best left to the application. The caller can set these values using the request header dictionary of the Query object, if the application requires it. Otherwise, the defaults provided by the JRE are probably OK.

G