Headers to be included in the request

@param headers Key-value pairs
436171
public PactDslRequestWithPath headers(Map<String, String> headers) {
      for (Map.Entry<String, String> entry: headers.entrySet()) {
        requestHeaders.put(entry.getKey(), Collections.singletonList(entry.getValue()));
      }
      return this;
    }
405972
public T headers(Map<String, Object> headers) {
        getMessageContentBuilder().getMessageHeaders().putAll(headers);
        return self;
    }
666413
public void setAllowHeaders(String... headers) {
        allowHeadersSet.clear();
        for (String header : headers) {
            allowHeadersSet.add(header.toLowerCase());
        }
        allowHeaders = Joiner.on(",").join(headers);
    }
600081
public void setHttpHeaders(java.util.Collection<HttpHeader> httpHeaders) {
        if (httpHeaders == null) {
            this.httpHeaders = null;
            return;
        }

        this.httpHeaders = new java.util.ArrayList<HttpHeader>(httpHeaders);
    }
963865
protected void addBasicAuthHeader(HttpHeaders headers, String key){
		headers.add(HEADER_AUTHORIZATION, buildBasicAuthValue(key));
	}
1032316
public void addHeader(Map<String, String> entries) {
        for (Map.Entry<String, String> entry : entries.entrySet()) {
            headerEntries.add(new HeaderEntry(entry.getKey(), entry.getValue()));
        }
    }
1320279
public RequestTemplate headers(Map<String, Collection<String>> headers) {
    if (headers != null && !headers.isEmpty()) {
      headers.forEach(this::header);
    } else {
      this.headers.clear();
    }
    return this;
  }
1252133
function setHeaders(req, headers) {
        var i;
        for (i = 0; i < headers.length; ++i) {
            req.setRequestHeader(headers[i][0], headers[i][1]);
        }
    }
859381
public void includeRequestHeader(String name, String value) {
        checkUpdatable();
        this.headers.put(name, value);
    }
219052
public HttpFileServiceBuilder addHeaders(Headers<AsciiString, String, ?> headers) {
        requireNonNull(headers, "headers");
        getOrCreateHeaders().add(headers);
        return this;
    }
814296
public PactDslRequestWithPath headers(String firstHeaderName, String firstHeaderValue, String... headerNameValuePairs) {
        if (headerNameValuePairs.length % 2 != 0) {
            throw new IllegalArgumentException("Pair key value should be provided, but there is one key without value.");
        }
        requestHeaders.put(firstHeaderName, Collections.singletonList(firstHeaderValue));

        for (int i = 0; i < headerNameValuePairs.length; i+=2) {
          requestHeaders.put(headerNameValuePairs[i], Collections.singletonList(headerNameValuePairs[i+1]));
        }

        return this;
    }
638895
public final B addHeaders(Headers<AsciiString, String, ?> headers) {
        requireNonNull(headers, "headers");
        getOrCreateHeaders().add(headers);
        return self();
    }
784945
@Override
    public void addHeader(String key, String value)
    {
        _conn.setRequestProperty(key, value);
    }
288688
public void addResponseHeaders(final HttpServletResponse servletResponse) {

        final String receivedParam = ofNullable(params.get("received")).orElse("");
        final List<String> includes = asList(ofNullable(params.get("include")).orElse(" ").split(" "));
        final List<String> omits = asList(ofNullable(params.get("omit")).orElse(" ").split(" "));

        final StringBuilder includeBuilder = new StringBuilder();
        final StringBuilder omitBuilder = new StringBuilder();

        if (!(value.equals("minimal") || receivedParam.equals("minimal"))) {
            final List<String> appliedPrefs = asList(PREFER_SERVER_MANAGED.toString(),
                    LDP_NAMESPACE + "PreferMinimalContainer",
                    LDP_NAMESPACE + "PreferMembership",
                    LDP_NAMESPACE + "PreferContainment");
            final List<String> includePrefs = asList(EMBED_CONTAINED.toString(),
                    INBOUND_REFERENCES.toString());
            includes.forEach(param -> includeBuilder.append(
                    (appliedPrefs.contains(param) || includePrefs.contains(param)) ? param + " " : ""));

            // Note: include params prioritized over omits during implementation
            omits.forEach(param -> omitBuilder.append(
                    (appliedPrefs.contains(param) && !includes.contains(param)) ? param + " " : ""));
        }

        // build the header for Preference Applied
        final String appliedReturn = value.equals("minimal") ? "return=minimal" : "return=representation";
        final String appliedReceived = receivedParam.equals("minimal") ? "received=minimal" : "";

        final StringBuilder preferenceAppliedBuilder = new StringBuilder(appliedReturn);
        preferenceAppliedBuilder.append(appliedReceived.length() > 0 ? "; " + appliedReceived : "");
        appendHeaderParam(preferenceAppliedBuilder, "include", includeBuilder.toString().trim());
        appendHeaderParam(preferenceAppliedBuilder, "omit", omitBuilder.toString().trim());

        servletResponse.addHeader("Preference-Applied", preferenceAppliedBuilder.toString().trim());

        servletResponse.addHeader("Vary", "Prefer");
    }
776382
public T header(Map<String, List<String>> headers) {
		return header(headers, false);
	}
360373
public void setHeaders(final Set<String> names) {
        // transform to lower-case because header names should be case-insensitive
        Set<String> lowerCaseNames = new HashSet<>();
        for (String name: names) {
            lowerCaseNames.add(name.toLowerCase());
        }
        this.headerNames = lowerCaseNames;
    }
1370431
public final void fromHttpHeaders(HttpHeaders headers) {
    try {
      ParseHeaderState state = new ParseHeaderState(this, null);
      serializeHeaders(
          headers, null, null, null, new HeaderParsingFakeLevelHttpRequest(this, state));
      state.finish();
    } catch (IOException ex) {
      // Should never occur as we are dealing with a FakeLowLevelHttpRequest
      throw Throwables.propagate(ex);
    }
  }