java: apache HttpClient > how to disable retry

前端 未结 5 2047
再見小時候
再見小時候 2021-02-01 16:41

I\'m using Apache Httpclient for Ajax-calls on a website. In some cases requests to external webservice fail, often with:

I/O exception (java.net.ConnectException) caug

5条回答
  •  天涯浪人
    2021-02-01 17:05

    client.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));
    

    That would do it.

提交回复
热议问题