This proposal introduces first-class support for the HTTP QUERY method, as defined by RFC 10008, into Jakarta REST.
Server API
This would be based on a single annotation:
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("QUERY")
public @interface QUERY {
}
Usage:
@Path("/users")
public class UserResource {
@QUERY
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<User> search(UserFilter filter) {
return service.search(filter);
}
}
Client API
Provide convenience methods for invoking QUERY requests without requiring generic method invocation.
Example:
client.target(uri)
.request()
.query(Entity.json(filter));
or equivalent API design determined by the specification committee.
Specification Goal
Define the semantics of QUERY according to RFC 10008:
- Safe
- Idempotent
- Allows request content
- Intended for retrieval and query operations
- Not intended for resource modification
This proposal introduces first-class support for the HTTP QUERY method, as defined by RFC 10008, into Jakarta REST.
Server API
This would be based on a single annotation:
Usage:
Client API
Provide convenience methods for invoking QUERY requests without requiring generic method invocation.
Example:
or equivalent API design determined by the specification committee.
Specification Goal
Define the semantics of QUERY according to RFC 10008: