{8.2.0-updated} @RemoteMethod
The {@link oaj.http.remote.RemoteMethod @RemoteMethod} annotation is applied to methods
of
The HTTP method and path are mapped to a Java method using the
The Java method name can be anything.
In such cases,
For example, the
In such cases, the
Method names matching the following pattern are assumed to be implying the HTTP method name:
(get|put|post|delete|options|head|connect|trace|patch).*
do(?i)(get|put|post|delete|options|head|connect|trace|patch)
Java method name | Inferred HTTP method | Inferred HTTP path |
---|---|---|
getPet() | GET | /pet |
get() | GET | / |
postPet() | POST | /pet |
fooPet() | [default] | /fooPet |
doGet() | GET | / |
doGET() | GET | / |
doFoo() | [default] | /doFoo |
The return type of the Java methods of can be any of the following:
If you're only interested in the HTTP status code of the response, you can use the {@link oaj.http.remote.RemoteMethod#returns() returns} annotation with a value of {@link oaj.http.remote.RemoteReturn#STATUS STATUS}:
If your