/** * Creates a URL by appending the given <i>path</i> to the public address * * @param ctx the handling context at the time the public address is needed * @param path the path to append to the public address * @return the public address with the given path appended * @deprecated since 1.2, use {@link #get(String)} */ @Deprecated default URI get(@SuppressWarnings("UnusedParameters") Context ctx, String path) { return builder().path(path).build(); }
/** * Creates a URL by building a URL based on the public address. * * @param ctx the handling context at the time the public address is needed * @param action the additions to the public address * @return the built url * @throws Exception any thrown by {@code action} * @deprecated since 1.2, use {@link #get(Action)} */ @Deprecated default URI get(@SuppressWarnings("UnusedParameters") Context ctx, Action<? super HttpUrlBuilder> action) throws Exception { return action.with(builder()).build(); }
/** * Creates a URL by building a URL based on the public address. * * @param action the additions to the public address * @return the built url * @throws Exception any thrown by {@code action} * @since 1.2 */ default URI get(Action<? super HttpUrlBuilder> action) throws Exception { return action.with(builder()).build(); }
/** * Creates a URL by appending the given <i>path</i> to the public address * * @param path the path to append to the public address * @return the public address with the given path appended * @since 1.2 */ default URI get(String path) { return builder().path(path).build(); }
@Override public ReceivedResponse request(String path, Action<? super RequestSpec> requestAction) { try (ExecController execController = new DefaultExecController(2)) { URI uri = builder(path).params(params).build(); try (HttpClient httpClient = httpClient()) { response = client.request(httpClient, uri, execController, Duration.ofMinutes(60), requestSpec -> { final RequestSpec decorated = new CookieHandlingRequestSpec(requestSpec); decorated.get(); defaultRequestConfig.execute(decorated); request.execute(decorated); requestAction.execute(decorated); }); } } catch (Throwable throwable) { throw uncheck(throwable); } extractCookies(response); return response; }