head.setConfig(requestConfig); if (sendAsFlowFile) { head.addHeader(TRANSACTION_ID_HEADER, transactionId);
private HttpHead doHead() { HttpHead method = new HttpHead(requestURI); for (Header header : headers) { method.addHeader(header); } return method; }
private HttpHead doHead() { HttpHead method = new HttpHead(requestURI); for (Header header : headers) { method.addHeader(header); } return method; }
@Override protected void setup(HttpHead req) throws IOException { super.setup(req); req.addHeader(NEWEST); } });
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; }
upmTokenRequest.addHeader("Accept", "application/vnd.atl.plugins.installed+json"); // UPM returns custom JSON content types.
upmTokenRequest.addHeader("Accept", "application/vnd.atl.plugins.installed+json"); // UPM returns custom JSON content types.
public static EdmWithCSRF readMetadataWithCSRF(String serviceUri, HttpClient httpClient, Map<String, String> headers, ErrorResultHandler<?> errorHandler, Boolean cacheMetadata,URL metadataFilePath,CacheKey cacheKey,Boolean isCacheRefresh) throws ClientProtocolException, IOException, ODataException { EdmWithCSRF edmWithCSRF = null; HttpResponse httpResponse = null; try { Edm edm = metadataCache.getEdm(serviceUri + "/$metadata", httpClient, headers, errorHandler, cacheMetadata,metadataFilePath,cacheKey,isCacheRefresh); HttpHead httpGet = new HttpHead(serviceUri); httpGet.setHeader(CSRF_HEADER, "Fetch"); if(headers != null) { for(Entry<String, String> e : headers.entrySet()) { httpGet.addHeader(e.getKey(), e.getValue()); } } httpResponse = httpClient.execute(httpGet); ODataConnectivityUtil.checkHttpStatus(httpResponse, errorHandler); // TODO - Code for null check. Header csrfHeader = httpResponse.getFirstHeader(CSRF_HEADER); String csrfToken = csrfHeader == null ? null : csrfHeader.getValue(); edmWithCSRF = new EdmWithCSRF(edm, csrfToken); return edmWithCSRF; } catch (Exception e) { logger.error("Error occurred during create operation of Type : " + e); throw e; }finally { HttpClientUtils.closeQuietly(httpResponse); } }
artifactVersionBean.getVersion()); HttpHead httpHead = new HttpHead(url); httpHead.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_CLOSE);
Header[] actualHeaders = response.getAllHeaders(); assertHeadersEquals(expectedHeaders, actualHeaders); head.addHeader(HttpHeaders.IF_NONE_MATCH, etag); response = getOrDelete(head, getAuthAccess(), false); assertEquals(SC_NOT_MODIFIED, response.getStatusLine().getStatusCode());
head.setConfig(requestConfig); if (sendAsFlowFile) { head.addHeader(TRANSACTION_ID_HEADER, transactionId);