private DestinationAccepts getDestinationAcceptance(final boolean sendAsFlowFile, final String uri, final String transactionId, final HttpContext httpContext) throws IOException { final HttpHead head = new HttpHead(uri); head.setConfig(requestConfig); if (sendAsFlowFile) { head.addHeader(TRANSACTION_ID_HEADER, transactionId);
private static HttpHead getHttpHead(ClientConfiguration config, String url, String cookie, String userAgent, Map<String, String> headers) { HttpHead httpHead = new HttpHead(url); // Request configuration can be overridden at the request level. // They will take precedence over the one set at the client level. RequestConfig requestConfig = config.getRequestConfig(); httpHead.setConfig(requestConfig); // httpget.addHeader("Host", "www.bbossgroups.com"); if(config.getKeepAlive()>0) httpHead.addHeader("Connection", "Keep-Alive"); // if (cookie != null) // httpHead.addHeader("Cookie", cookie); // if (userAgent != null) // httpHead.addHeader("User-Agent", userAgent); if (headers != null && headers.size() > 0) { Iterator<Entry<String, String>> entries = headers.entrySet().iterator(); while (entries.hasNext()) { Entry<String, String> entry = entries.next(); httpHead.addHeader(entry.getKey(), entry.getValue()); } } return httpHead; }
.build(); HttpHead head = AccessController.doPrivileged((PrivilegedAction<HttpHead>) () -> new HttpHead(location)); head.setConfig(rc);
head.setConfig(buildRequestConfig());
/** * Performs a HEAD request for the specified URL and options * * @param url * the URL * @param options * the options * @return the response as JSON * @throws IOException * In case an I/O exception occurs */ public static final String head(String url, String options) throws IOException { HttpClientRequestOptions httpClientRequestOptions = parseOptions(options); CloseableHttpClient httpClient = HttpClientProxyUtils.getHttpClient(httpClientRequestOptions.isSslTrustAllEnabled()); RequestConfig config = prepareConfig(httpClientRequestOptions); HttpHead httpHead = new HttpHead(url); httpHead.setConfig(config); prepareHeaders(httpClientRequestOptions, httpHead); CloseableHttpResponse response = httpClient.execute(httpHead); return processResponse(response, httpClientRequestOptions.isBinary()); }
/** * Performs a HEAD request for the specified URL and options * * @param url * the URL * @param options * the options * @return the response as JSON * @throws IOException * In case an I/O exception occurs */ public static final String head(String url, String options) throws IOException { HttpClientRequestOptions httpClientRequestOptions = parseOptions(options); CloseableHttpClient httpClient = HttpClientProxyUtils.getHttpClient(httpClientRequestOptions.isSslTrustAllEnabled()); RequestConfig config = prepareConfig(httpClientRequestOptions); HttpHead httpHead = new HttpHead(url); httpHead.setConfig(config); prepareHeaders(httpClientRequestOptions, httpHead); CloseableHttpResponse response = httpClient.execute(httpHead); return processResponse(response, httpClientRequestOptions.isBinary()); }
private DestinationAccepts getDestinationAcceptance(final boolean sendAsFlowFile, final String uri, final String transactionId, final HttpContext httpContext) throws IOException { final HttpHead head = new HttpHead(uri); head.setConfig(requestConfig); if (sendAsFlowFile) { head.addHeader(TRANSACTION_ID_HEADER, transactionId);
final RequestConfig context = client.context().getRequestConfig(); final HttpHead request = new HttpHead(new DAVPathEncoder().encode(home)); request.setConfig(RequestConfig.copy(context).setRedirectsEnabled(false).build()); final Header location = client.execute(request, new ValidatingResponseHandler<Header>() { @Override
request.setConfig(RequestConfig.custom() .setConnectionRequestTimeout(1000) .setConnectTimeout(1000)