Examples of resetHeaders()


Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException
     */
    public HttpRequest buildConditionalRequest(HttpRequest request, CacheEntry cacheEntry)
            throws ProtocolException {
        RequestWrapper wrapperRequest = new RequestWrapper(request);
        wrapperRequest.resetHeaders();
        Header eTag = cacheEntry.getFirstHeader(HeaderConstants.ETAG);
        if (eTag != null) {
            wrapperRequest.setHeader(HeaderConstants.IF_NONE_MATCH, eTag.getValue());
        } else {
            Header lastModified = cacheEntry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException when I am unable to build a new origin request.
     */
    public HttpRequest buildConditionalRequest(HttpRequest request, HttpCacheEntry cacheEntry)
            throws ProtocolException {
        RequestWrapper wrapperRequest = new RequestWrapper(request);
        wrapperRequest.resetHeaders();
        Header eTag = cacheEntry.getFirstHeader(HeaderConstants.ETAG);
        if (eTag != null) {
            wrapperRequest.setHeader(HeaderConstants.IF_NONE_MATCH, eTag.getValue());
        }
        Header lastModified = cacheEntry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException when I am unable to build a new origin request.
     */
    public HttpRequest buildConditionalRequestFromVariants(HttpRequest request, Set<HttpCacheEntry> variantEntries)
            throws ProtocolException {
        RequestWrapper wrapperRequest = new RequestWrapper(request);
        wrapperRequest.resetHeaders();

        // we do not support partial content so all etags are used
        StringBuilder etags = new StringBuilder();
        boolean first = true;
        for (HttpCacheEntry entry : variantEntries) {
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException
     */
    public HttpRequest buildUnconditionalRequest(HttpRequest request,
            HttpCacheEntry entry) throws ProtocolException {
        RequestWrapper wrapped = new RequestWrapper(request);
        wrapped.resetHeaders();
        wrapped.addHeader("Cache-Control","no-cache");
        wrapped.addHeader("Pragma","no-cache");
        wrapped.removeHeaders("If-Range");
        wrapped.removeHeaders("If-Match");
        wrapped.removeHeaders("If-None-Match");
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException when I am unable to build a new origin request.
     */
    public HttpRequest buildConditionalRequest(HttpRequest request, HttpCacheEntry cacheEntry)
            throws ProtocolException {
        RequestWrapper wrapperRequest = new RequestWrapper(request);
        wrapperRequest.resetHeaders();
        Header eTag = cacheEntry.getFirstHeader(HeaderConstants.ETAG);
        if (eTag != null) {
            wrapperRequest.setHeader(HeaderConstants.IF_NONE_MATCH, eTag.getValue());
        }
        Header lastModified = cacheEntry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

            wrapperRequest = new RequestWrapper(request);
        } catch (ProtocolException pe) {
            log.warn("unable to build conditional request", pe);
            return request;
        }
        wrapperRequest.resetHeaders();

        // we do not support partial content so all etags are used
        StringBuilder etags = new StringBuilder();
        boolean first = true;
        for(String etag : variants.keySet()) {
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

            wrapped = new RequestWrapper(request);
        } catch (ProtocolException e) {
            log.warn("unable to build proper unconditional request", e);
            return request;
        }
        wrapped.resetHeaders();
        wrapped.addHeader(HeaderConstants.CACHE_CONTROL,HeaderConstants.CACHE_CONTROL_NO_CACHE);
        wrapped.addHeader(HeaderConstants.PRAGMA,HeaderConstants.CACHE_CONTROL_NO_CACHE);
        wrapped.removeHeaders(HeaderConstants.IF_RANGE);
        wrapped.removeHeaders(HeaderConstants.IF_MATCH);
        wrapped.removeHeaders(HeaderConstants.IF_NONE_MATCH);
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

     * @throws ProtocolException when I am unable to build a new origin request.
     */
    public HttpRequest buildConditionalRequest(HttpRequest request, HttpCacheEntry cacheEntry)
            throws ProtocolException {
        RequestWrapper wrapperRequest = new RequestWrapper(request);
        wrapperRequest.resetHeaders();
        Header eTag = cacheEntry.getFirstHeader(HeaderConstants.ETAG);
        if (eTag != null) {
            wrapperRequest.setHeader(HeaderConstants.IF_NONE_MATCH, eTag.getValue());
        }
        Header lastModified = cacheEntry.getFirstHeader(HeaderConstants.LAST_MODIFIED);
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

            wrapperRequest = new RequestWrapper(request);
        } catch (ProtocolException pe) {
            log.warn("unable to build conditional request", pe);
            return request;
        }
        wrapperRequest.resetHeaders();

        // we do not support partial content so all etags are used
        StringBuilder etags = new StringBuilder();
        boolean first = true;
        for(String etag : variants.keySet()) {
View Full Code Here

Examples of org.apache.http.impl.client.RequestWrapper.resetHeaders()

            wrapped = new RequestWrapper(request);
        } catch (ProtocolException e) {
            log.warn("unable to build proper unconditional request", e);
            return request;
        }
        wrapped.resetHeaders();
        wrapped.addHeader("Cache-Control","no-cache");
        wrapped.addHeader("Pragma","no-cache");
        wrapped.removeHeaders("If-Range");
        wrapped.removeHeaders("If-Match");
        wrapped.removeHeaders("If-None-Match");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.