Add one header to the HttpHeaders collection.

@param headerName must not be {@literal null} or empty.
@param headerValue can be {@literal null}.
@return
424017
public Hop header(String headerName, String headerValue) {

		Assert.hasText(headerName, "headerName must not be null or empty!");

		if (this.headers == HttpHeaders.EMPTY) {

			HttpHeaders newHeaders = new HttpHeaders();
			newHeaders.add(headerName, headerValue);

			return new Hop(this.rel, this.parameters, newHeaders);
		}

		this.headers.add(headerName, headerValue);
		return this;
	}
1200677
public void setLongHeader (@Nonnull @Nonempty final String sName, final long nValue)
  {
    _setHeader (sName, Long.toString (nValue));
  }
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));
    }
1162893
public RequestBuilder<T,ID> addHeader(String name,String value)
    {
        headers.add(name, value);
        return this;
    }
621354
public HttpClientVerifyBuilder withHeader(String header, String value) {
        return withHeader(header, equalTo(value));
    }
1091237
public function addHeader($headerKey, $headerValue)
    {
        if (!is_string($headerKey)) {
            throw new \InvalidArgumentException('Expected headerKey to be a string');
        }

        if (!is_scalar($headerValue)) {
            throw new \InvalidArgumentException('Expected headerValue to be a scalar');
        }

        $oldValue = null;
        if (array_key_exists($headerKey, $this->headers)) {
            $oldValue = $this->headers[$headerKey];
        }

        $this->headers[$headerKey] = $headerValue;

        return $oldValue;
    }
605650
public Map<String, String> createHeadersFromString(String headersAndValues) {

    if (headersAndValues == null || headersAndValues.isEmpty()) return Collections.emptyMap();

    final StringTokenizer token = new StringTokenizer(headersAndValues, "@");

    final Map<String, String> theHeaders = new HashMap<String, String>(token.countTokens());

    while (token.hasMoreTokens()) {
      final String headerAndValue = token.nextToken();
      if (!headerAndValue.contains(":"))
        throw new IllegalArgumentException(
            "Request headers wrongly configured, missing separator :" + headersAndValues);

      final String header = headerAndValue.substring(0, headerAndValue.indexOf(":"));
      final String value =
          headerAndValue.substring(headerAndValue.indexOf(":") + 1, headerAndValue.length());
      theHeaders.put(header, value);
    }

    return theHeaders;

  }
1155456
public void setRequestHeader(String header, String value) {
        LOG.entering(CLASS_NAME, "setRequestHeader", new Object[] {header, value});
        HttpRequestUtil.validateHeader(header);
        connection.addRequestProperty(header, value);
    }
840992
public RequestOptions addHeader(String name, String value) {
        if (headers == null) {
            headers = new CaseInsensitiveHeaders();
        }
        headers.add(name, value);
        return this;
    }
1273283
@NotNull
	public HttpResponse withHeader(@NotNull HttpHeader header, @NotNull String value) {
		addHeader(header, value);
		return this;
	}
141979
@Override
	public void add(String headerName, String headerValue) {
		List<String> headerValues = headers.get(headerName);
		if (headerValues == null) {
			headerValues = new LinkedList<String>();
			this.headers.put(headerName, headerValues);
		}
		headerValues.add(headerValue);
	}
343425
public void put(HttpHeader header, String value) {
        if (value == null)
            remove(header);
        else
            put(new HttpField(header, value));
    }
1032088
public String putHeader(final String name, final String value) {
        if (headers == null) {
            headers = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
        }
        return headers.put(name, value);
    }
870679
public function addHeader($header, $headerValue)
    {
        if (\is_string($header) && \is_string($headerValue)) {
            $this->_config['headers'][$header] = $headerValue;
        } else {
            throw new InvalidException('Header must be a string');
        }

        return $this;
    }
481678
public function addHeaderValue($header, $headerValue): Builder
    {
        if (!isset($this->headers[$header])) {
            $this->headers[$header] = $headerValue;
        } else {
            $this->headers[$header] = array_merge((array)$this->headers[$header], [$headerValue]);
        }
        $this->removePlugin(Plugin\HeaderAppendPlugin::class);
        $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers));

        return $this;
    }
1167807
public HttpFileServiceBuilder addHeader(CharSequence name, Object value) {
        requireNonNull(name, "name");
        requireNonNull(value, "value");
        getOrCreateHeaders().addObject(HttpHeaderNames.of(name), value);
        return this;
    }
1241941
public T header(String name, String value) {
        connection.setRequestProperty(name, value);
        return (T) this;
    }