code: public static String getHeaders(HttpMethod method) {
          String headerString = "";
          Header[] headers = method.getRequestHeaders();
          for (Header header : headers) {
              String name = header.getName();
              if (name.equals(Constants.ODO_PROXY_HEADER)) {
                  // skip.. don't want to log this
                  continue;
              }
  
              if (headerString.length() != 0) {
                  headerString += "\n";
              }
  
              headerString += header.getName() + ": " + header.getValue();
          }
  
          return headerString;
      }
docs: Obtain newline-delimited headers from method
  
  @param method HttpMethod to scan
  @return newline-delimited headers