public boolean containsHeader( String arg0 ) { return responseBase.containsHeader( arg0 ); }
@Override public String getHeader(String header) { if (!response.containsHeader(header)) { return null; } return response.getFirstHeader(header).getValue(); } }
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { if (response == null) { throw new IllegalArgumentException ("HTTP response may not be null."); } int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { if (response == null) { throw new IllegalArgumentException("HTTP request may not be null"); } if (!response.containsHeader(HTTP.SERVER_HEADER)) { String s = (String) response.getParams().getParameter( CoreProtocolPNames.ORIGIN_SERVER); if (s != null) { response.addHeader(HTTP.SERVER_HEADER, s); } } }
@Test public void shouldSupportContainsHeader() throws Exception { HttpResponse resp = new TestHttpResponse(304, "ZOMBO", new BasicHeader("X-Zombo-Com", "Welcome")); assertThat(resp.containsHeader("X-Zombo-Com")).isTrue(); assertThat(resp.containsHeader("Location")).isFalse(); }
throw new IllegalArgumentException("HTTP request may not be null"); if (response.containsHeader(HTTP.TRANSFER_ENCODING)) { throw new ProtocolException("Transfer-encoding header already present"); if (response.containsHeader(HTTP.CONTENT_LEN)) { throw new ProtocolException("Content-Length header already present"); if (entity.getContentType() != null && !response.containsHeader( HTTP.CONTENT_TYPE )) { response.addHeader(entity.getContentType()); if (entity.getContentEncoding() != null && !response.containsHeader( HTTP.CONTENT_ENCODING)) { response.addHeader(entity.getContentEncoding());
public boolean containsHeader( String arg0 ) { return responseBase.containsHeader( arg0 ); }
/** * @return a boolean indicating if response contains given header. * @param name header name * @throws IllegalArgumentException if given name == null or name.isEmpty() */ public boolean containsHeader(String name) throws IllegalArgumentException { if (name == null || name.isEmpty()) throw new IllegalArgumentException("Null/Empty name"); return coreResponse.containsHeader(name); }
@Override public String handleResponse(HttpResponse response) throws IOException { this.validateResponse(response); if(response.containsHeader(HttpHeaders.ETAG)) { return response.getFirstHeader(HttpHeaders.ETAG).getValue(); } return null; } }
/** * {@inheritDoc} */ @Override public boolean containsHeader(String name) { return (response != null ? response.containsHeader(name) : super.containsHeader(name)); }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); final int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { final String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); final int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { final String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); if (!response.containsHeader(HTTP.SERVER_HEADER)) { if (this.originServer != null) { response.addHeader(HTTP.SERVER_HEADER, this.originServer); } } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); if (!response.containsHeader(HTTP.SERVER_HEADER)) { if (this.originServer != null) { response.addHeader(HTTP.SERVER_HEADER, this.originServer); } } }
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); if (!response.containsHeader(HTTP.SERVER_HEADER)) { if (this.originServer != null) { response.addHeader(HTTP.SERVER_HEADER, this.originServer); } } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); if (!response.containsHeader(HTTP.SERVER_HEADER)) { if (this.originServer != null) { response.addHeader(HTTP.SERVER_HEADER, this.originServer); } } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); final int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { final String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); final int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { final String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
@Override public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { Args.notNull(response, "HTTP response"); final int status = response.getStatusLine().getStatusCode(); if ((status >= HttpStatus.SC_OK) && !response.containsHeader(HTTP.DATE_HEADER)) { final String httpdate = DATE_GENERATOR.getCurrentDate(); response.setHeader(HTTP.DATE_HEADER, httpdate); } }
public void process(final HttpResponse response, final HttpContext context) throws HttpException, IOException { if (response == null) { throw new IllegalArgumentException("HTTP request may not be null"); } if (!response.containsHeader(HTTP.SERVER_HEADER)) { String s = (String) response.getParams().getParameter( CoreProtocolPNames.ORIGIN_SERVER); if (s != null) { response.addHeader(HTTP.SERVER_HEADER, s); } } }