/** * Sets the cookies on this request by overwriting the value of the "Cookie" header. * * @param cookies cookies * @return {@code this} */ public Builder cookies(Collection<RequestCookie> cookies) { requireNonNull(cookies); headers.remove(COOKIE); if (!cookies.isEmpty()) { header(COOKIE, encode(cookies)); } return this; }
/** * Sets the cookies on this request by overwriting the value of the "Cookie" header. * * @param cookies cookies * @return this builder */ @Override public Builder cookies(Collection<RequestCookie> cookies) { requireNonNull(cookies); headers.remove(COOKIE); if (!cookies.isEmpty()) { header(COOKIE, encode(cookies)); } return this; }
/** * Sets the cookies on this response by removing existing "Set-Cookie" headers and adding new ones. * * @param cookies cookies * @return {@code this} */ public Builder cookies(Collection<ResponseCookie> cookies) { requireNonNull(cookies); headers.remove(SET_COOKIE); return addCookies(cookies); }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Sets the cookies on this response by removing existing "Set-Cookie" headers and adding new ones. * * @param cookies cookies * @return {@code this} */ public Builder cookies(Collection<ResponseCookie> cookies) { requireNonNull(cookies); headers.remove(SET_COOKIE); return addCookies(cookies); }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public SELF removeHeader(CharSequence name) { headers.remove(name); return (SELF) this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Makes this response chunked. * * @return {@code this} */ public Builder setChunked() { headers.add(TRANSFER_ENCODING, CHUNKED); headers.remove(CONTENT_LENGTH); return this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Makes this response chunked. * * @return {@code this} */ public Builder setChunked() { headers.add(TRANSFER_ENCODING, CHUNKED); headers.remove(CONTENT_LENGTH); return this; }
/** * Makes this response chunked. * * @return {@code this} */ public Builder setChunked() { headers.add(TRANSFER_ENCODING, CHUNKED); headers.remove(CONTENT_LENGTH); return this; }
/** * Makes this response chunked. * * @return {@code this} */ public Builder setChunked() { headers.add(TRANSFER_ENCODING, CHUNKED); headers.remove(CONTENT_LENGTH); return this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ @Override public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }
/** * Set the response to be chunked. * * @return {@code this} */ public SELF chunked() { headers().add(TRANSFER_ENCODING, CHUNKED); headers().remove(CONTENT_LENGTH); return (SELF) this; }
/** * Removes the header with the specified name. * * @param name The name of the header to remove * @return {@code this} */ public Builder removeHeader(CharSequence name) { headers.remove(name); return this; }