MCPcopy Create free account
hub / github.com/BaseXdb/basex / client

Method client

basex-core/src/main/java/org/basex/io/IOUrl.java:173–181  ·  view source on GitHub ↗

Returns a singleton HTTP client instance. @param redirect follow redirects @return client builder

(final boolean redirect)

Source from the content-addressed store, hash-verified

171 * @return client builder
172 */
173 public static HttpClient client(final boolean redirect) {
174 final int i = redirect ? 1 : 0;
175 if(CLIENTS[i] == null) {
176 final HttpClient.Builder cb = HttpClient.newBuilder();
177 if(ssl != null) cb.sslContext(ssl).connectTimeout(Duration.ofMinutes(1));
178 CLIENTS[i] = cb.followRedirects(redirect ? Redirect.ALWAYS : Redirect.NEVER).build();
179 }
180 return CLIENTS[i];
181 }
182
183 /**
184 * Returns the reason phrase for a status code.

Callers 3

sendMethod · 0.95
responseMethod · 0.95
sendMethod · 0.95

Calls 1

buildMethod · 0.45

Tested by 1

sendMethod · 0.76