HTTP Part Basics
In previous examples we showed the ability to pass in annotated parameters on RestOp-annotated methods to parse standard HTTP parts:
Example
@RestGet("/example1/{a1}/*")
public String doGetExample1(
@Path("a1") String a1,
@Query("p1") int p1,
@HasQuery("p2") boolean hasP3,
@Path("/*") String remainder,
@Header("Accept-Language") String lang
) {
// Do something with all of those
}
Annotations are provided for both request and response HTTP parts.
The annotations used for defining the schema for request HTTP parts are:
HTTP request parts:
HTTP response parts:
These annotation can be used on method parameters or on the parameter types themselves, or a combination of both.
note
When defined on types, annotations are aggregated from parent to child with child values taking precedence. When defined on both, annotations are aggregated with values on parameters taking precedence.