Add HTTP Basic Auth header
@param headers	the headers, it must not be a read-only one, if it is, use {@link #copy(HttpHeaders)} to make a writable copy first
@param key		the API key
963865
protected void addBasicAuthHeader(HttpHeaders headers, String key){
		headers.add(HEADER_AUTHORIZATION, buildBasicAuthValue(key));
	}
617679
protected function addAuthHeader(&$headers) {
		$user = $this->account->getKey();
		$password = $this->account->getSecret();

		$headers['Authorization'] = 'Basic ' . base64_encode("$user:$password");
	}
1338471
public void addHeader(String s) throws IOException
    {
        Integer h=(Integer)__headerMap.get(s);
        if (h!=null)
            addInt(h.intValue());
        else
            addString(s);
    }
1032316
public void addHeader(Map<String, String> entries) {
        for (Map.Entry<String, String> entry : entries.entrySet()) {
            headerEntries.add(new HeaderEntry(entry.getKey(), entry.getValue()));
        }
    }
1202697
def header(self, headers):
        
        if isinstance(headers, list):
            for h in headers:
                self.add_header(h)
        else:
            self.add_header(headers)
671104
public static Condition withHeader(final String key, final String... expectedHeaders) {
        return new Condition(input -> {
            for (Map.Entry<String, List<String>> e : input.getHeaders().entrySet()) {
                if (e.getKey().equalsIgnoreCase(key)) {
                    return (expectedHeaders == null && e.getValue() == null)
                            || match(e.getValue(), asList(expectedHeaders));
                }
            }
            return false;
        });
    }
638895
public final B addHeaders(Headers<AsciiString, String, ?> headers) {
        requireNonNull(headers, "headers");
        getOrCreateHeaders().add(headers);
        return self();
    }
738153
public void doHead(String url, HttpResponse response, Map<String, Object> headers) {
        response.setRequest(url);
        httpClient.head(url, response, headers);
    }
651036
static void addHeaders(HttpUriRequest httpRequest, HttpHeaders headers) {
		for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
			String headerName = entry.getKey();
			if (HttpHeaders.COOKIE.equalsIgnoreCase(headerName)) {  // RFC 6265
				String headerValue = StringUtils.collectionToDelimitedString(entry.getValue(), "; ");
				httpRequest.addHeader(headerName, headerValue);
			}
			else if (!HTTP.CONTENT_LEN.equalsIgnoreCase(headerName) &&
					!HTTP.TRANSFER_ENCODING.equalsIgnoreCase(headerName)) {
				for (String headerValue : entry.getValue()) {
					httpRequest.addHeader(headerName, headerValue);
				}
			}
		}
	}
564395
public void setHeader(java.util.Collection<String> header) {
        if (header == null) {
            this.header = null;
            return;
        }

        this.header = new java.util.ArrayList<String>(header);
    }
1018090
@Override
  public void header(String key, String value)
  {
    _is.header(key, value);
  }
1245330
public void addRequestHttpHeader(Map<String, String> httpHeader) {

        if (this.requestHttpHeaders == null)
            this.requestHttpHeaders = new HashMap<>();

        this.requestHttpHeaders.putAll(httpHeader);
    }
1324250
public HttpHeaders set(HttpHeaders headers) {
        checkNotNull(headers, "headers");

        clear();

        if (headers.isEmpty()) {
            return this;
        }

        for (Entry<String, String> entry : headers) {
            add(entry.getKey(), entry.getValue());
        }
        return this;
    }
1363475
@Override
    public void setResponseHeader(String key, String value) {
        this.response.setResponseHeader(key, value);
    }
776382
public T header(Map<String, List<String>> headers) {
		return header(headers, false);
	}
666413
public void setAllowHeaders(String... headers) {
        allowHeadersSet.clear();
        for (String header : headers) {
            allowHeadersSet.add(header.toLowerCase());
        }
        allowHeaders = Joiner.on(",").join(headers);
    }
485929
public CustomHeadersInterceptor addHeaderMap(Map<String, String> headers) {
        for (Map.Entry<String, String> header : headers.entrySet()) {
            this.headers.put(header.getKey(), Collections.singletonList(header.getValue()));
        }
        return this;
    }