headers relates methods
963283
@Override
    public void sendError(int sc, String msg) throws IOException {
        if (isCommitted()) {
            throw new IllegalStateException("Cannot set error status - response is already committed");
        }
        notifyBeforeCommit();
        super.sendError(sc, msg);
        setCommitted();
    }
944321
private static function headers() {
        if (empty(self::$config['httpHeaders'])) {
            return;
        }

        $response = self::$config['httpContext']->getResponse();
        $response->setHeaders(self::$config['httpHeaders']);
    }
1090415
protected function method_head()
	{
		$this->method_get();

		$this->set_option(CURLOPT_NOBODY, true);
		$this->set_option(CURLOPT_HEADER, true);

	}
366458
protected void moskitoDoHead(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		super.doHead(req, res);
	}
1295258
def header
      header = client.header
      param[:header].each do |h|
        k, v = h.split(": ")
        header[k] = v
      end
      header
    end
1095275
def headers(headers={}):
    
    def decorator(f):
        @wraps(f)
        def decorated_function(*args, **kwargs):
            resp = make_response(f(*args, **kwargs))
            h = resp.headers
            for header, value in headers.items():
                h[header] = value
            return resp
        return decorated_function
    return decorator
582519
public void addHeader( String name, String value )
    {
        headers.add( new BasicHeader( name, value ) );
    }
392090
function combineHeaders(...args) {
  const combinedLower = {};
  const combined = {};
  args.reverse();
  args.forEach((headers) => {
    if (headers) {
      Object.keys(headers).forEach((name) => {
        const nameLower = name.toLowerCase();
        if (!hasOwnProperty.call(combinedLower, nameLower)) {
          combinedLower[nameLower] = true;
          combined[name] = headers[name];
        }
      });
    }
  });
  return combined;
}
626945
public void setHeader (File header)
    {
        try {
            _header = StreamUtil.toString(new FileReader(header));
        } catch (IOException ioe) {
            System.err.println("Unabled to load header '" + header + ": " +
                               ioe.getMessage());
        }
    }
412694
function Headers(headers) {
	            var _this = this;
	            /** @internal header names are lower case */
	            this._headers = new Map();
	            /** @internal map lower case names to actual names */
	            this._normalizedNames = new Map();
	            if (!headers) {
	                return;
	            }
	            if (headers instanceof Headers) {
	                headers._headers.forEach(function (values, name) {
	                    values.forEach(function (value) { return _this.append(name, value); });
	                });
	                return;
	            }
	            Object.keys(headers).forEach(function (name) {
	                var values = Array.isArray(headers[name]) ? headers[name] : [headers[name]];
	                _this.delete(name);
	                values.forEach(function (value) { return _this.append(name, value); });
	            });
	        }
172412
public T header(String name, String value) {
        Collection<String> l = headers.get(name);
        if (l == null) {
            l = new ArrayList<String>();
        }
        l.add(value);
        headers.put(name, l);
        return derived.cast(this);
    }
828264
function onHeaders(ev, status, newUrl, oldUrl, statusCode, method, referrer, headers, resourceType) {
    if (resourceType !== 'mainFrame') return;

    let headerArray = [];

    Object.keys(headers).forEach(name => {
      headers[name].forEach(value => {
        headerArray.push({ name, value });
      });
    });

    response = {
      url: newUrl,
      method,
      status: statusCode,
      contentType: headers['content-type'][0],
      headers: headerArray
    };

    notify([ 'header event', status, newUrl, oldUrl, statusCode, method, referrer, headers, resourceType ]);
  }
21484
public void setHeader(HeaderFooter header) {
        this.header = header;
        DocListener listener;
		for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
            listener = (DocListener) iterator.next();
            listener.setHeader(header);
        }
    }
440201
def header(cls, name, type_=Type.String, description=None, default=None, required=None, **options):
        
        return cls(name, In.Header, type_, None, description,
                   required=required, default=default,
                   **options)
394411
function(method, data, callback) {
      xhr.open(method, url, true, user, password);
      if (mimeType != null && !headers.has("accept")) headers.set("accept", mimeType + ",*/*");
      if (xhr.setRequestHeader) headers.each(function(value, name) { xhr.setRequestHeader(name, value); });
      if (mimeType != null && xhr.overrideMimeType) xhr.overrideMimeType(mimeType);
      if (responseType != null) xhr.responseType = responseType;
      if (timeout > 0) xhr.timeout = timeout;
      if (callback == null && typeof data === "function") callback = data, data = null;
      if (callback != null && callback.length === 1) callback = fixCallback(callback);
      if (callback != null) request.on("error", callback).on("load", function(xhr) { callback(null, xhr); });
      event.call("beforesend", request, xhr);
      xhr.send(data == null ? null : data);
      return request;
    }
586377
public Response andHeaders(Map<HttpString, String> headers) {
        Objects.requireNonNull(headers, Required.HEADERS.toString());
        this.headers.putAll(headers);

        return this;
    }
754555
public final B setHeaders(Headers<AsciiString, String, ?> headers) {
        requireNonNull(headers, "headers");
        if (!headers.isEmpty()) {
            getOrCreateHeaders().setAll(headers);
        }
        return self();
    }