presto-main/src/main/java/io/prestosql/dispatcher/QueuedStatementResource.java/QueuedStatementResource/postStatement
class QueuedStatementResource:    @POST
    @Path("/v1/statement")
    @Produces(APPLICATION_JSON)
    public Response postStatement(
            String statement,
            @HeaderParam(X_FORWARDED_PROTO) String xForwardedProto,
            @Context HttpServletRequest servletRequest,
            @Context UriInfo uriInfo)
    {
        if (isNullOrEmpty(statement)) {
            throw badRequest(BAD_REQUEST, "SQL statement is empty");
        }

        SessionContext sessionContext = new HttpRequestSessionContext(forwardedHeaderSupport, servletRequest);
        Query query = new Query(statement, sessionContext, dispatchManager);
        queries.put(query.getQueryId(), query);

        return Response.ok(query.getQueryResults(query.getLastToken(), uriInfo, xForwardedProto)).build();
    }