Encodes the specified cookie into a Cookie header value.

@param name
the cookie name
@param value
the cookie value
@return a Rfc6265 style Cookie header value
967070
public String encode(String name, String value) {
        return encode(new DefaultCookie(name, value));
    }
253088
public void addHeader(String name, String value) {
        httpRequest.headers().add(name, value);
    }
1093515
public String cookie(String name) {
        Cookie[] cookies = servletRequest.getCookies();
        if (cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookie.getName().equals(name)) {
                    return cookie.getValue();
                }
            }
        }
        return null;
    }
1030911
public final B addHeader(CharSequence name, Object value) {
        requireNonNull(name, "name");
        requireNonNull(value, "value");
        getOrCreateHeaders().addObject(HttpHeaderNames.of(name), value);
        return self();
    }
1308887
public final static void addCookie(String name, String value) {
		getServletResponse().addCookie(new Cookie(name, value));
	}
556564
public void setHeader(String name, String value) {
		if (headers == null) {
			headers = new HashMap<String, String>();
		}
		if (value != null) {
			headers.put(name, value);
		} else {
			headers.remove(name);
		}
	}
483660
public String getJavaScriptHtmlCookieString(String name, String value) {
        return getJavaScriptHtmlCookieString(name, value, null);
    }
1170429
public final String setHeader(String name, String value) {
        sortedHeaders = null;
        return headers.put(name, value);
    }
972103
public HttpHubConnectionBuilder withHeader(String name, String value) {
        if (headers == null) {
            this.headers = new HashMap<>();
        }
        this.headers.put(name, value);
        return this;
    }
692581
public HeaderParams put(String name, String value) {
        values.put(cleanAndValidate(name), cleanAndValidate(value));
        return this;
    }
840992
public RequestOptions addHeader(String name, String value) {
        if (headers == null) {
            headers = new CaseInsensitiveHeaders();
        }
        headers.add(name, value);
        return this;
    }
373142
@SuppressWarnings("unchecked")
	public T addHeader(final String name, final String value) {
		List<String> values = new ArrayList<String>();
		values.add(value);

		this.headers.put(name, values);
		return (T) this;
	}
728349
public static Cookie cookie(String name){
        javax.servlet.http.Cookie[] servletCookies = RequestContext.getHttpRequest().getCookies();
        if (servletCookies != null) {
            for (javax.servlet.http.Cookie servletCookie : servletCookies) {
                if (servletCookie.getName().equals(name)) {
                    return Cookie.fromServletCookie(servletCookie);
                }
            }
        }
        return null;
    }
1236706
public final function cookie(string $name, string $value = null)
    {
        return ($value === null) ? $this->getCookie($name) : $this->setCookie($name, $value);
    }
1070726
public Response header(String name, Date value) {
        checkCommitted();

        getHeaderMap().put(name, DateUtils.formatForHttpHeader(value));

        return this;
    }
901741
public void setHeader(String name, String value) {
//		int pos = 0;
//		int crlfpos = 0;
        Pattern pattern = null;

        if (getHeaders(name) == null && value != null) {
            // header value not found, append to end
            addHeader(name, value);
        } else {
            pattern = getHeaderRegex(name);
            Matcher matcher = pattern.matcher(mMsgHeader);
            if (value == null) {
                // delete header
                mMsgHeader = matcher.replaceAll("");
            } else {
                // replace header
                String newString = name + ": " + value + mLineDelimiter;
                mMsgHeader = matcher.replaceAll(Matcher.quoteReplacement(newString));
            }

            // set into hashtable
            replaceInternalHeaderFields(name, value);
        }
    }
879575
public ProxySettings addHeader(String name, String value)
    {
        if (name == null || name.length() == 0)
        {
            return this;
        }

        List<String> list = mHeaders.get(name);

        if (list == null)
        {
            list = new ArrayList<String>();
            mHeaders.put(name, list);
        }

        list.add(value);

        return this;
    }