Set header parameters to the request builder, including default headers.

@param headerParams Header parameters in the ofrm of Map
@param reqBuilder Reqeust.Builder
763522
public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) {
        for (Entry<String, String> param : headerParams.entrySet()) {
            reqBuilder.header(param.getKey(), parameterToString(param.getValue()));
        }
        for (Entry<String, String> header : defaultHeaderMap.entrySet()) {
            if (!headerParams.containsKey(header.getKey())) {
                reqBuilder.header(header.getKey(), parameterToString(header.getValue()));
            }
        }
    }
1291458
public T addHeaders(Map<String, String> headers) {
		if(CollectionUtil.isEmpty(headers)) {
			return (T)this;
		}
		
		for (Entry<String,String> entry : headers.entrySet()) {
			this.header(entry.getKey(), StrUtil.nullToEmpty(entry.getValue()), false);
		}
		return (T)this;
	}
392554
private static Map<String, String> __getRequestHeaderMap(HttpServletRequest req) {
        Map<String, String> reqHeaders = new LinkedHashMap<>();
        Enumeration<String> headerNames = req.getHeaderNames();
        if (headerNames != null) {
            while (headerNames.hasMoreElements()) {
                String headerName = headerNames.nextElement();
                Enumeration<String> headerValues = req.getHeaders(headerName);

                if (headerValues != null) {
                    StringBuilder headerValueBuilder = new StringBuilder();
                    int i = 0;
                    while (headerValues.hasMoreElements()) {
                        if (i > 0) {
                            headerValueBuilder.append(", ");
                        }

                        headerValueBuilder.append(headerValues.nextElement());
                        i++;
                    }

                    reqHeaders.put(headerName, headerValueBuilder.toString());
                } else {
                    reqHeaders.put(headerName, "");
                }
            }
        }
        return reqHeaders;
    }
1039399
private void applyHeaders(Invocation.Builder builder, Map<String, Object> headers)
    {
        if(headers != null)
        {
            for (Map.Entry<String, Object> e : headers.entrySet())
            {
                builder.header(e.getKey(), e.getValue());
            }
        }
    }
503173
public Header[] head(String endpoint, String params) throws IOException {
        return this.head(endpoint, params, "");
    }
1198703
@Override
    public void addRequestHeader(String headerName, String headerValue) {
        addRequestHeader(new Header(headerName, headerValue));
    }
1054372
public void setCustomHeader(String[] header) {
        if (header == null) {
            throw new IllegalArgumentException("Custom header can't be null.");
        }
        customHeader = new CustomHeaderLine[header.length];
        for (int i = 0; i < header.length; i++) {
            customHeader[i] = new CustomHeaderLine(header[i]);
        }
    }
964743
public GenericResponseBuilder<T> header(String name, Object value) {
    rawBuilder.header(name, value);
    return this;
  }
1186051
public void addHeader(String name, String value) {
	headers = ReqRspUtil.add(headers, name, value);
    }
266263
public void setParameters(Map<String, String> parameters) {

        if (m_parameters != null) {
            throw new IllegalStateException();
        }
        m_parameters = parameters;
    }
1350733
@Override
    public void setRequestHeader(Header header) {
        
        Header[] headers = getRequestHeaderGroup().getHeaders(header.getName());
        
        for (int i = 0; i < headers.length; i++) {
            getRequestHeaderGroup().removeHeader(headers[i]);
        }
        
        getRequestHeaderGroup().addHeader(header);
        
    }
230013
protected Response buildHeader(final WebApplicationService service, final Map<String, String> parameters) {
        return DefaultResponse.getHeaderResponse(service.getOriginalUrl(), parameters);
    }
828966
private void populateRequestHeaders(HttpRequestBase httpRequest, Map<String, String> requestHeaders) {

        Set<String> keySet = requestHeaders.keySet();
        Iterator<String> keySetIterator = keySet.iterator();
        while (keySetIterator.hasNext()) {
            String key = keySetIterator.next();
            String value = requestHeaders.get(key);
            httpRequest.addHeader(key, value);
        }

        PropertyHelper propertyHelper = PropertyHelper.getInstance();
        String requestSource = propertyHelper.getRequestSource() + propertyHelper.getVersion();
        if(propertyHelper.getRequestSourceHeader() != null){
            httpRequest.addHeader(propertyHelper.getRequestSourceHeader(), requestSource);
        }

    }
1077377
public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams) {
        for (String authName : authNames) {
            Authentication auth = authentications.get(authName);
            if (auth == null) throw new RuntimeException("Authentication undefined: " + authName);
            auth.applyToParams(queryParams, headerParams);
        }
    }
438859
public FunctionCallBuilder requiresHeader(String headerName, boolean useQuotes) {
        headers.add(new HeaderDefinition(headerName, useQuotes, HeaderDefinition.PRIORITY_NORMAL));
        return this;
    }
322183
public TemplateBuilder parameters(Map<String, String> parameters) {
		action.getParameter().putAll(parameters);
		return this;
	}
1133709
public void setParameters(Map<String, String> parameters) {
        this.parameters.clear();
        this.parameters.putAll(parameters);
    }