public HttpURLConnection processURL(String spec, String requestMethod, InputStream body, Map<String, List<String>> headers)
      throws IOException {

    return processURL(spec, requestMethod, body == null ? null : IOUtils.toByteArray(body), headers);
  }
Get a URL connection from the given spec.

@param spec           the String to parse as a URL
@param requestMethod  the HTTP method (GET,POST,PUT,etc.).
@param body           the body of the request; may be null
@param headers        the headers of the request; may be null

@return a URL connection

@throws IOException if the URL connection can not be established
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/URLStreamProvider.java