private Request createPostRequest(HttpHeaders headers, RequestBody body, UriInfo uriInfo, ResourceInstance resource) {
    boolean batchCreate = !applyDirectives(Request.Type.POST, body, uriInfo, resource);;

    return (batchCreate) ?
        new QueryPostRequest(headers, body, uriInfo, resource) :
        new PostRequest(headers, body, uriInfo, resource);
  }
Create a POST request.  This will either be a standard post request or a query post request.
A query post request first applies a query to a collection resource and then creates
sub-resources to all matches of the predicate.

@param headers   http headers
@param uriInfo   uri information
@param resource  associated resource instance

@return new post request
ambari-server/src/main/java/org/apache/ambari/server/api/services/RequestFactory.java