| 185 | } |
| 186 | |
| 187 | @PostMapping(path = "/submit/form", consumes = MULTIPART_FORM_DATA_VALUE) |
| 188 | public ResponseEntity<String> submitRepeatableFormParam( |
| 189 | @RequestParam("names") Collection<String> names) { |
| 190 | var response = new StringBuilder(); |
| 191 | if (names != null && names.size() == 2) { |
| 192 | var iterator = names.iterator(); |
| 193 | response.append(iterator.next()).append(" and ").append(iterator.next()); |
| 194 | } |
| 195 | var status = response.length() > 0 ? OK : I_AM_A_TEAPOT; |
| 196 | |
| 197 | return ResponseEntity.status(status).body(response.toString()); |
| 198 | } |
| 199 | |
| 200 | @PostMapping(path = "/form-data", consumes = APPLICATION_FORM_URLENCODED_VALUE) |
| 201 | public ResponseEntity<String> submitPostData( |