You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Chad La Joie <la...@itumi.biz> on 2010/09/08 02:21:33 UTC

Header Constants and Date Parsing

I have a suggestion and a question.

First, I'd like to suggest creating an HTTP header names constant file 
similar to HttpStatus.  A few HTTP defined header names are defined on 
the HTTP object but not the majority of them.  While there are lots of 
different specs that define HTTP headers I'm just suggesting those 
defined in the HTTP specifications themselves.

Second, a question.  Is there a utility to parse HTTP dates into 
something a bit more friendly to work with.  Something like 
java.util.Date or milliseconds since the epoch?

-- 
Chad La Joie
http://itumi.biz
trusted identities, delivered

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Header Constants and Date Parsing

Posted by Chad La Joie <la...@itumi.biz>.

On 9/8/10 6:01 AM, Oleg Kalnichevski wrote:
> On Tue, 2010-09-07 at 20:21 -0400, Chad La Joie wrote:
>> I have a suggestion and a question.
>>
>> First, I'd like to suggest creating an HTTP header names constant file
>> similar to HttpStatus.  A few HTTP defined header names are defined on
>> the HTTP object but not the majority of them.  While there are lots of
>> different specs that define HTTP headers I'm just suggesting those
>> defined in the HTTP specifications themselves.
>>
>
> We will happily accept such class if contributed.

Done.  https://issues.apache.org/jira/browse/HTTPCORE-232
Note, Apache already has my contribution agreement so that's all set.

>
>> Second, a question.  Is there a utility to parse HTTP dates into
>> something a bit more friendly to work with.  Something like
>> java.util.Date or milliseconds since the epoch?
>>
>
> There is o.a.h.impl.cookie.DateUtils class in HttpClient module that
> simplifies parsing and formatting of date attributes in HTTP headers.
>
> See if that is what you want.

Yeah, that looks like what I need.  Thanks.

-- 
Chad La Joie
http://itumi.biz
trusted identities, delivered

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Header Constants and Date Parsing

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Tue, 2010-09-07 at 20:21 -0400, Chad La Joie wrote:
> I have a suggestion and a question.
> 
> First, I'd like to suggest creating an HTTP header names constant file 
> similar to HttpStatus.  A few HTTP defined header names are defined on 
> the HTTP object but not the majority of them.  While there are lots of 
> different specs that define HTTP headers I'm just suggesting those 
> defined in the HTTP specifications themselves.
> 

We will happily accept such class if contributed.


> Second, a question.  Is there a utility to parse HTTP dates into 
> something a bit more friendly to work with.  Something like 
> java.util.Date or milliseconds since the epoch?
> 

There is o.a.h.impl.cookie.DateUtils class in HttpClient module that
simplifies parsing and formatting of date attributes in HTTP headers.

See if that is what you want.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org