@Documented @Target(value=PARAMETER) @Retention(value=RUNTIME) @Inherited public @interface HasFormData
@RestMethod
annotated method to identify whether or not
the request has the specified multipart form POST parameter.
Note that this can be used to detect the existence of a parameter when it's not set to a particular value.
This is functionally equivalent to the following code...
The following table shows the behavioral differences between @HasFormData
and @FormData
...
Body content |
|
|
---|---|---|
a=foo |
||
a= |
||
a |
||
b=foo |
@Body
annotation or RestRequest.getBody()
method
for application/x-www-form-urlencoded POST
posts, since it will trigger the underlying servlet API to
parse the body content as key-value pairs, resulting in empty content.
The @HasQuery
annotation can be used to check for the existing of a URL parameter in the URL string
without triggering the servlet to drain the body content.
Copyright © 2018 Apache. All rights reserved.