{8.2.0-updated} @FormData

The {@link oaj.http.annotation.FormData @FormData} annotation can be applied to arguments of @RemoteMethod-annotated methods to denote that they are form-data parameters on the request.

Example:

@Remote(path="/myproxy") public interface MyProxy { // Explicit names specified for form data parameters. @RemoteMethod String postParameters( @FormData("foo") String foo, @FormData("bar") MyPojo pojo ); // Multiple values pulled from a NameValuePairSupplier object. // Name "*" is inferred. @RemoteMethod String postNameValuePairs(@FormData NameValuePairSupplier nameValuePairSupplier); // Multiple values pulled from a Map. @RemoteMethod String postMap(@FormData Map<String,Object> map); // Multiple values pulled from a bean. @RemoteMethod String postBean(@FormData MyBean bean); // An entire form-data HTTP body as a String. @RemoteMethod String postString(@FormData String string); // An entire form-data HTTP body as a Reader. @RemoteMethod String postReader(@FormData Reader reader); }

Single-part arguments (i.e. those with name != "*") can be any of the following types:

Multi-part arguments (i.e. those with name == "*" or empty) can be any of the following types:

See the link below for information about supported data types in OpenAPI serialization.