Hi,
I am using httpcore-4.-beta2 and httpclient-4.0-alpha4.
When I issue a request with a BasicHttpContext, I see log messages
indicating:
13-aug-2008 16:24:47 org.apache.http.client.protocol.RequestAddCookies
process
INFO: Cookie store not available in HTTP context
Apart that I think these should be warnings, I tried to circumvent these by
adding a Cookie store:
context.setAttribute(ClientContext.COOKIE_STORE, new BasicCookieStore());
Only to find the next message:
13-aug-2008 16:26:12 org.apache.http.client.protocol.RequestAddCookies
process
INFO: CookieSpec registry not available in HTTP context
When I proceed, as in, adding a CookieSpecRegistry:
context.setAttribute(ClientContext.COOKIESPEC_REGISTRY, new
CookieSpecRegistry());
It breaks...
java.lang.IllegalStateException: Unsupported cookie spec: best-match
at
org.apache.http.cookie.CookieSpecRegistry.getCookieSpec(CookieSpecRegistry.java:115)
at
org.apache.http.client.protocol.RequestAddCookies.process(RequestAddCookies.java:147)
at
org.apache.http.protocol.BasicHttpProcessor.process(BasicHttpProcessor.java:290)
at
org.apache.http.protocol.HttpRequestExecutor.preProcess(HttpRequestExecutor.java:160)
at
org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:356)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:501)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:456)
at
com.thespeechcorporation.service.RequestCallable.call(RequestCallable.java:33)
at
com.thespeechcorporation.service.RequestCallable.call(RequestCallable.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Basically, I want to do a request without to bother with Cookie's for my
application isn't dealing with these. I was hoping/expecting that the
BasicHttpContext would take care of defaults...
Unless, I am doing something terribly wrong and/or make wrong assumptions.
How to proceed? Sure, I can raise/lower debug level so I wont see the log
messages but that would be the under_the_carpet trick?
Regards,
Mike
--
View this message in context:
http://www.nabble.com/BasicHttpContext-and-CookieStore-tp18964323p18964323.html
Sent from the HttpClient-User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]