jenkinsci / jenkinsci/java-client-api

a Questions about httpClient

Open
#275 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
913
Forks
466
PR merge metrics
No merged PRs in 30d

Description

the source code in JenkinsHttpClient
a request to jenkins use CloseableHttpClient such as

public T get(String path, Class cls) throws IOException {
HttpGet getMethod = new HttpGet(api(path));

HttpResponse response = client.execute(getMethod, localContext);
getJenkinsVersionFromHeader(response);
try {
httpResponseValidator.validateResponse(response);
return objectFromResponse(cls, response);
} finally {
EntityUtils.consume(response.getEntity());
releaseConnection(getMethod);
}
}
, sometimes my request can't received by jenkins and Code should not be run to end, cause by my network is not stable , so how can i to add timeout for api ??

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.