Return a concatenated string of all the headers

@param   req    Incoming HttpServletRequest object
@return  header values
558302
public static String getHeaders(final HttpServletRequest req) {
    Enumeration en = req.getHeaderNames();
    StringBuffer sb = new StringBuffer();

    while (en.hasMoreElements()) {
      String name = (String) en.nextElement();
      sb.append(name);
      sb.append(": ");
      sb.append(req.getHeader(name));
      sb.append("\n");
    }
    return sb.toString();
  }
436357
public Headers toHeaders() {
        Headers headers = new Headers();
        if (!getMatch().isEmpty()) {
            headers = headers.add(new Header(HeaderConstants.IF_MATCH, buildTagHeaderValue(getMatch())));
        }
        if (!getNoneMatch().isEmpty()) {
            headers = headers.add(new Header(HeaderConstants.IF_NONE_MATCH, buildTagHeaderValue(getNoneMatch())));
        }
        if (modifiedSince.isPresent()) {
            headers = headers.set(HeaderUtils.toHttpDate(HeaderConstants.IF_MODIFIED_SINCE, modifiedSince.get()));
        }
        if (unModifiedSince.isPresent()) {
            headers = headers.set(HeaderUtils.toHttpDate(HeaderConstants.IF_UNMODIFIED_SINCE, unModifiedSince.get()));
        }

        return headers;
    }
853825
function headersToString(headers) {
  let ret = [];
  headers.forEach(function(value, name) {
    ret.push(`${name.toLowerCase()}: ${value}`);
  });
  return ret.join('\n');
}
483254
@Override
    public List<String> headers(String name) {
        return request.headers().get(name);
    }
1274624
@Nonnull
  @ReturnsMutableCopy
  public static HttpHeaderMap getRequestHeaderMap (@Nonnull final HttpServletRequest aHttpRequest)
  {
    ValueEnforcer.notNull (aHttpRequest, "HttpRequest");

    final HttpHeaderMap ret = new HttpHeaderMap ();
    final Enumeration <String> aHeaders = aHttpRequest.getHeaderNames ();
    while (aHeaders.hasMoreElements ())
    {
      final String sName = aHeaders.nextElement ();
      final Enumeration <String> eHeaderValues = aHttpRequest.getHeaders (sName);
      while (eHeaderValues.hasMoreElements ())
      {
        final String sValue = eHeaderValues.nextElement ();
        ret.addHeader (sName, sValue);
      }
    }
    return ret;
  }
449165
function (req) {
    var keys = Object.keys(req.headers)

    var values = keys.map(function (key) {
      return req.headers[key]
    })

    var headers = req.method + req.url + keys.join() + values.join()

    // startline: [method] [url] HTTP/1.1\r\n = 12
    // endline: \r\n = 2
    // every header + \r\n = * 2
    // add 2 for each combined header
    return new Buffer(headers).length + (keys.length * 2) + 2 + 12 + 2
  }
107599
protected String getHeader( ITransaction transaction,
                                String path,
                                HttpServletResponse resp,
                                HttpServletRequest req ) {
        return "<h1>Content of folder " + path + "</h1>";
    }
583156
protected String getJWTFromCookie(HttpServletRequest req) {
        String serializedJWT = null;
        Cookie[] cookies = req.getCookies();
        if (cookieName != null && cookies != null) {
            for (Cookie cookie : cookies) {
                if (cookieName.equals(cookie.getName())) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("{} cookie has been found and is being processed", cookieName);
                    }
                    serializedJWT = cookie.getValue();
                    break;
                }
            }
        }
        return serializedJWT;
    }
319208
protected StringBuffer getHeaderSection(HttpServletRequest request){
	
		StringBuffer sb = super.getHeaderSection(request);
		if(null != this.config.getDwrMapping()){
			sb.append(DWRParamWriter.buildDWRJSParams(request.getContextPath(),PathNormalizer.joinPaths(request.getContextPath(),  
																						 			this.config.getDwrMapping())));
			sb.append("if(!window.DWR)window.DWR={};\nDWR.loader = JAWR.loader;\n");
		}
		return sb;
	}
1161196
public static String getRequestHeadersOutput(HTTP http) {
        if (http == null) {
            return "";
        }
        StringBuilder requestHeaders = new StringBuilder();
        String uuid = getUUID();
        requestHeaders.append(ONCLICK_TOGGLE).append(uuid).append("\")'>Toggle Headers</a> ");
        requestHeaders.append(SPAN_ID).append(uuid).append(DISPLAY_NONE);
        requestHeaders.append(formatKeyPair(http.getHeaders()));
        requestHeaders.append(END_SPAN);
        return requestHeaders.toString();
    }
950059
private Pair<String, String>[] getAllParams(final HttpServletRequest req) {
    final List<Pair<String, String>> allParams = new LinkedList<>();

    final Iterator it = req.getParameterMap().entrySet().iterator();
    while (it.hasNext()) {
      final Map.Entry pairs = (Map.Entry) it.next();
      for (final Object value : (String[]) pairs.getValue()) {
        allParams.add(new Pair<>((String) pairs.getKey(), (String) value));
      }
    }

    return allParams.toArray(new Pair[allParams.size()]);
  }
826638
public static String getServletURL (HttpServletRequest req, String path)
    {
        StringBuffer buf = req.getRequestURL();
        String sname = req.getServletPath();
        buf.delete(buf.length() - sname.length(), buf.length());
        if (!path.startsWith("/")) {
            buf.append("/");
        }
        buf.append(path);
        return buf.toString();
    }
375270
public static Set<String> getParameters (HttpServletRequest req, String name)
    {
        Set<String> set = new HashSet<String>();
        String[] values = req.getParameterValues(name);
        if (values != null) {
            for (int ii = 0; ii < values.length; ii++) {
                if (!StringUtil.isBlank(values[ii])) {
                    set.add(values[ii]);
                }
            }
        }
        return set;
    }
867684
private Map<String, List<Request>> requests(
        final Request req) throws IOException {
        final String header = new RqHeaders.Smart(req).single("Content-Type");
        if (!new EnglishLowerCase(header).string()
            .startsWith("multipart/form-data")) {
            throw new HttpException(
                HttpURLConnection.HTTP_BAD_REQUEST,
                String.format(
                    // @checkstyle LineLength (1 line)
                    "RqMtBase can only parse multipart/form-data, while Content-Type specifies a different type: \"%s\"",
                    header
                )
            );
        }
        final Matcher matcher = RqMtBase.BOUNDARY.matcher(header);
        if (!matcher.matches()) {
            throw new HttpException(
                HttpURLConnection.HTTP_BAD_REQUEST,
                String.format(
                    "boundary is not specified in Content-Type header: \"%s\"",
                    header
                )
            );
        }
        final ReadableByteChannel body = Channels.newChannel(this.stream);
        if (body.read(this.buffer) < 0) {
            throw new HttpException(
                HttpURLConnection.HTTP_BAD_REQUEST,
                "failed to read the request body"
            );
        }
        final byte[] boundary = String.format(
            "%s--%s", RqMtBase.CRLF, matcher.group(1)
        ).getBytes(RqMtBase.ENCODING);
        this.buffer.flip();
        this.buffer.position(boundary.length - 2);
        final Collection<Request> requests = new LinkedList<>();
        while (this.buffer.hasRemaining()) {
            final byte data = this.buffer.get();
            if (data == '-') {
                break;
            }
            this.buffer.position(this.buffer.position() + 1);
            requests.add(this.make(boundary, body));
        }
        return RqMtBase.asMap(requests);
    }
763363
public Map<String, String> getRequestHeaders() {
        Map<String, String> hdrs = new HashMap<>();
        hdrs.put("Content-Type", "application/json");
        hdrs.put("environment", getSlackPrefix());
        return hdrs;
    }
923530
public Headers getAllHeaders() {
        Headers requestHeaders = getHeaders();
        requestHeaders = hasPayload() ? requestHeaders.withContentType(getPayload().get().getMimeType()) : requestHeaders;
        //We don't want to add headers more than once.
        return requestHeaders;
    }
169581
public List<String> getValuesList(HttpHeader header) {
        final List<String> list = new ArrayList<>();
        for (HttpField f : this)
            if (f.getHeader() == header)
                list.add(f.getValue());
        return list;
    }