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 da...@aol.com on 2017/01/02 04:57:39 UTC

Parse cookie with HttpClient?

I am working with a web service that returns cookies in the response http body instead of the response headers.
I need to add these cookies to the HtmlUnit WebClient instance.
I have extracted the cookie string. Are there any methods that automatically parse the cookie string? or would I have to parse the cookie manually and separate it by domain, name, value, etc...?

Re: Parse cookie with HttpClient?

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2017-01-01 at 23:57 -0500, davidjesse091@aol.com wrote:
> I am working with a web service that returns cookies in the response
> http body instead of the response headers.
> I need to add these cookies to the HtmlUnit WebClient instance.
> I have extracted the cookie string. Are there any methods that
> automatically parse the cookie string? or would I have to parse the
> cookie manually and separate it by domain, name, value, etc...?

CookeSpec#parse is your friend.

Oleg

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