Annotation Type RequestPart
Binds one part of a multipart/form-data request body to this parameter.
@PostMapping("/avatar")
public String upload(@RequestPart("file") HttpServer.Part file) {
store(file.getFilename(), file.getBytes());
return "stored " + file.getSize() + " bytes";
}
The parameter is a com.codename1.backend.HttpServer.Part -- name, filename,
content type and bytes -- or byte[] for the content alone, or String for
a text field. A body that is not well-formed multipart is answered 400 before
the method runs, as is a missing required part.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhether a request without the part is rejected.
-
Element Details
-
value
String valueThe part's name, from its Content-Disposition. Required for the same reasonRequestParam's is: a parameter's own name does not survive compilation. -
required
boolean requiredWhether a request without the part is rejected.- Default:
true
-