Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6834751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:09:01+00:00 2026-05-26T23:09:01+00:00

The HTTP commons client 4.12 tutorial section on exception handling clearly shows that one

  • 0

The HTTP commons client 4.12 tutorial section on exception handling clearly shows that one should be able to set a request retry handler by doing the following…

httpclient.setHttpRequestRetryHandler(myRetryHandler);

in eclipse I tried that and it reports HttpClient has no such method. It suggests i cast the client to AbstractHttpClient then call .setHttpRequestRetryHandler like so:

((AbstractHttpClient) httpclient).setHttpRequestRetryHandler(myRetryHandler);

then my code works, but this discrepancy between documentation and API makes me wonder if I’m doing something I shouldn’t.

Is the documentation wrong or is it me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:09:02+00:00Added an answer on May 26, 2026 at 11:09 pm

    You’re totally correct. The documentation uses a concrete DefaultHttpClient (which is a subclass of AbstractHttpClient and so has the setHttpRequestRetryHandler() method.

    As you are doing the right thing and programming to the HttpClient interface (which sadly doesn’t expose that method), you have to do that nasty cast.

    It looks like the Apache team have decided to keep the HttpClient interface super-clean, at the expense of client code 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use apache commons http client to send data via post every second, is
I am trying to use jakarta commons http client. Doing kerberos authentication to communicate
I am working to change the HTTP client in an application from Commons HTTP
If you visit http://www.tenxian.com/jp/common/signup.php? with Firefox, you will find that the button 同意して、アカウントを作成します is
See section /* Common Classes */ of this page. http://webdesign.about.com/od/css/a/master_stylesht_2.htm are these css classes
http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can
http://localhost/XYZ/Client/(S(enlodz55ov4ncafza0gpp045))/Info/Rates.aspx Does anyway know what /(S(enlodz55ov4ncafza0gpp045))/ means? Any help appreciated.
http://leepoint.net/notes-java/data/expressions/22compareobjects.html It turns out that defining equals() isn't trivial; in fact it's moderately hard
I am using apache http commons 4.I have added both httpcore-4.0.1.jar and httpclient-4.0.1.jar in
I'm using Apache Common library for HTTP operations: HttpClient client = getClient(); PutMethod put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.