{title:'HTTP Parts', updated:'9.0.0'}

In previous examples we showed the ability to pass in annotated parameters on {@link oajr.annotation.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:

These annotation can be used on method parameters or on the parameter types themselves, or a combination of both.