Hi friends,
Today I was trying to use httpclient to generate some http requests.
However, I am not able to go past the first step itself. I am getting errors
for following classes :
import org.apache.commons.httpclient.HttpClient;
import
On 06/01/2010, Ajay Bansal ajay.bansa...@gmail.com wrote:
Hi friends,
Today I was trying to use httpclient to generate some http requests.
However, I am not able to go past the first step itself. I am getting errors
for following classes :
import
hi
I think org.apache.httpcomponents.httpclient are the new packages from
4.0 version
org.apache.commons.httpclient are the old ones for 3.x versions
see the examples (and use IDE Autocompletion) to be sure ;-)
Hope that helps
florent
Pingwy
27, rue des arènes
49100 Angers
Ajay Bansal
Not working. :(
To be more specific :
Here is my classpath (I am using eclipse)
classpath
classpathentry kind=src path=src/
classpathentry kind=con
path=org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6/
classpathentry kind=con
While I am trying to solve those import issues, I would like to execute
following request using java code
--header=X-P-Timestamp: 1262780093 --header=X-P-PAccessId:
3NJZKDY87A97 --header=X-PSignature: ClYCatFCVDV0= --header=Accept:
application/xml http://localhost:8080/pri-api/demo/catalog;
My mistake :-)
org.apache.httpcomponents:httpclient may be the maven's artifact name
I've just checked in my code : org.apache.http.client should work
However if these imports are in a piece of code that used to work, it seems to be it have been designed to
use HttpClient 3.x and not 4.x
A
True. I also discovered that :).
I actually just used one the example files given on the site.
On Wed, Jan 6, 2010 at 10:09 PM, Ken Krugler kkrugler_li...@transpac.comwrote:
You're trying to use HttpClient 3.0 package names with the 4.0 jar.
For example, my imports for using HttpClient 4.0
[trying again w/o code formatting, hopefully Apache mail server won't
reject it as spam]
Here's the code I use to set up for sending generic https GET requests.
// Create and initialize scheme registry
SchemeRegistry schemeRegistry = new SchemeRegistry();
Hi,
I'm using http-client 4.0.1.
Is there any way to use HttpRequestRetryHandler to handle retry on
ConnectTimeoutException ? (I did it with http client 3 )
Thanks,
--
Olivier
-
To unsubscribe, e-mail:
Hi all,
Olivier , Maybe i could not answer your question but i have one question .
Sometimes i got the Read timeout orConnection reset orStream
close exceptions .
and Read timeout exception is the most one.
How do you use HttpRequestRetryHandler to handle Read timeout exception ?
I
Thanks for reply.
Yes I already use this for this type of exception.
But this doesn't catch the ConnectionTimeOut.
--
Olivier
2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com:
Hi all,
Olivier , Maybe i could not answer your question but i have one question .
Sometimes i got the Read
From my experience, you get a ConnectTimeoutException when you've
made a configuration or implementation mistake. E.g.
- your connection pool size isn't big enough given the number of
simultaneous threaded requests.
- you're not releasing connections properly (e.g. when aborting a
request)
NO.
ConnectionTimeOutException can means the target endPoint cannot be contacted.
My software POST some datas to various systems : company ones and
externals one.
Sometimes some systems are on small maintenance mode or during a
restart time or some other stuffs.
What I like is to not failed
Sure.
It's just I found this more elegant/readable code using the retry
handler mechanism rather than writing catch/loop as with http client
3.x.
--
Olivier
2010/1/6 Ken Krugler kkrugler_li...@transpac.com:
On Jan 6, 2010, at 12:49pm, Olivier Lamy wrote:
NO.
ConnectionTimeOutException can
Luke Pillow wrote:
Hello,
I'd like to use the HTTPClient, but I'm restricted to Java 1.4.2.
Is 3.1 compatible with Java 1.4.2?
HttpClient 3.x requires Java 1.2.2
Is 4.x compatible with Java 1.4.2?
HttpClient 4.x requires Java 1.5.0. However, HttpCore - a set of low
level transport
Olivier Lamy wrote:
Sure.
It's just I found this more elegant/readable code using the retry
handler mechanism rather than writing catch/loop as with http client
3.x.
While I agree with Ken that retrying requests on ConnectTimeoutException
feels wrong, it is certainly incorrect that retry
16 matches
Mail list logo