Sets key-value header on response
502327
public static Action header(final String key, final String value) {
        return new Action(input -> {
            input.setHeader(key, value);
            return input;
        });
    }
106004
function header (request) {

    var headers = assign({}, Http.headers.common,
        !request.crossOrigin ? Http.headers.custom : {},
        Http.headers[toLower(request.method)]
    );

    each(headers, function (value, name) {
        if (!request.headers.has(name)) {
            request.headers.set(name, value);
        }
    });

}
1105629
public function header($key, $value = null)
	{
		if( is_null($value) )
		{
			$pos = strpos($key, ":");
			if( ! $pos )
			{
				return $this;
			}

			$value = substr($key, $pos + 1);
			$key = substr($key, 0, $pos);
		}
		$this->headers->set($key, $value);
		return $this;
	}
90878
def h_v_t(header, key):
        
        if key not in header:
            key = key.title()

            if key not in header:
                raise ValueError("Unexpected header in response, missing: " + key + " headers:\n" + str(header))

        return header[key]
1081572
def set_header(self, name, value):
        
        self._headers[_hkey(name)] = [_hval(value)]
804789
function headerFactory(key, value) {
  
  var headers = {};
  if (arguments.length === 2) {
    headers[key] = value;
  } else {
    headers = key;
  }
  return function header(req, res, next) {
    for (var name in headers) {
      if (headers.hasOwnProperty(name)) {
        res.setHeader(name, headers[name]);
      }
    }
    next();
  };
}
856389
def _set_custom_headers(self, value):
        '''
        
        '''
        if value is None:
            setattr(self, '_PMMail__custom_headers', {})
        elif isinstance(value, dict):
            setattr(self, '_PMMail__custom_headers', value)
        else:
            raise TypeError('Custom headers must be a dictionary of key-value pairs')
711505
public void addHeaderOutImpl(String key, String value)
  {
    if (headerOutSpecial(key, value)) {
      return;
    }
    
    ArrayList<String> keys = _headerKeysOut;
    ArrayList<String> values = _headerValuesOut;
    
    int size = keys.size();
    
    // webapp/1k32
    for (int i = 0; i < size; i++) {
      if (keys.get(i).equals(key) && values.get(i).equals(value)) {
        return;
      }
    }

    keys.add(key);
    values.add(value);
  }
1273283
@NotNull
	public HttpResponse withHeader(@NotNull HttpHeader header, @NotNull String value) {
		addHeader(header, value);
		return this;
	}
648821
public function setHeader($key, $value)
    {
        $key = strtolower($key);
        $this->headers[$key] = $value;
    }
36863
def add(self, key, value):
        """"""
        if key not in self.headers:
            self.headers[key] = []
        self.headers[key].append(value)

        if self.sent_time:
            self.modified_since_sent = True
335077
public void setHeader(String name, String value) {
	headers = ReqRspUtil.set(headers, name, value);
    }
1029013
function getResponseHeader(header) {
            if (this.readyState < IsotropyXMLHttpRequest.HEADERS_RECEIVED) {
                return null;
            }

            if (/^Set-Cookie2?$/i.test(header)) {
                return null;
            }

            header = header.toLowerCase();

            for (var h in this.responseHeaders) {
                if (h.toLowerCase() == header) {
                    return this.responseHeaders[h];
                }
            }

            return null;
        }
210364
public Request header(String key, String value) {
        this.headers.put(key, value);
        return this;
    }
202665
function parseResponseHeaders (headers) {
  var parsed = {};

  if (headers) {
    headers.split('\n').forEach(function (line) {
      var separatorIndex = line.indexOf(':');
      var key = line.substr(0, separatorIndex).trim().toLowerCase();
      var value = line.substr(separatorIndex + 1).trim().toLowerCase();

      if (key) {
        parsed[key] = value;
      }
    });
  }

  return parsed;
}
489292
protected void populateResponseHeaders(Set<String> requestHeaderKeys, Map<String,String> metaInfo, HttpServletResponse response) {
        for (String key : metaInfo.keySet()) {
            if (!Listener.AUTHENTICATED_USER_HEADER.equals(key)
                    && !Listener.AUTHENTICATED_JWT.equals(key)
                    && !Listener.METAINFO_HTTP_STATUS_CODE.equals(key)
                    && !Listener.METAINFO_ACCEPT.equals(key)
                    && !Listener.METAINFO_CONTENT_TYPE.equals(key)
                    && !Listener.METAINFO_DOWNLOAD_FORMAT.equals(key)
                    && !Listener.METAINFO_MDW_REQUEST_ID.equals(key)
                    && !requestHeaderKeys.contains(key))
                response.setHeader(key, metaInfo.get(key));
        }

        // these always get populated if present
        if (metaInfo.get(Listener.METAINFO_REQUEST_ID) != null)
            response.setHeader(Listener.METAINFO_REQUEST_ID, metaInfo.get(Listener.METAINFO_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID) != null && !metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID).equals("0"))
            response.setHeader(Listener.METAINFO_MDW_REQUEST_ID, metaInfo.get(Listener.METAINFO_MDW_REQUEST_ID));
        if (metaInfo.get(Listener.METAINFO_CORRELATION_ID) != null)
            response.setHeader(Listener.METAINFO_CORRELATION_ID, metaInfo.get(Listener.METAINFO_CORRELATION_ID));
        if (metaInfo.get(Listener.METAINFO_DOCUMENT_ID) != null)
            response.setHeader(Listener.METAINFO_DOCUMENT_ID, metaInfo.get(Listener.METAINFO_DOCUMENT_ID));
    }
335191
public void addHeader(String key, String value) {
        if (key.equals("As-User")) {
            for (int i = 0; i < this.headers.size(); i++) {
                if (this.headers.get(i).getKey().equals("As-User")) {
                    this.headers.remove(i);
                }
            }
        }
        if (key.equals("X-Box-UA")) {
            throw new IllegalArgumentException("Altering the X-Box-UA header is not permitted");
        }
        this.headers.add(new RequestHeader(key, value));
    }