code: public RESTResponse sendRequest(HttpMethod method, String uri,
                                      ContentType contentType, byte[] body)
              throws IOException {
          Map<String, String> headers = new HashMap<>();
          if (contentType != null) {
              headers.put(HttpDefs.CONTENT_TYPE, contentType.toString());
          }
          return sendAndReceive(method, uri, headers, body);
      }
docs: Send a REST command with the given method, URI, content-type, and body to the
  server and return the response in a {@link RESTResponse} object.
  
  @param method        HTTP method such as "GET" or "POST".
  @param uri           URI such as "/foo/bar?baz"
  @param contentType   Content-Type of body such as "application/json".
  @param body          Input entity to send with request in binary.
  @return              {@link RESTResponse} containing response from server.
  @throws IOException  If an error occurs on the socket.