| 198 | } |
| 199 | |
| 200 | @PostMapping(path = "/form-data", consumes = APPLICATION_FORM_URLENCODED_VALUE) |
| 201 | public ResponseEntity<String> submitPostData( |
| 202 | @RequestParam("f_name") String firstName, @RequestParam("age") Integer age) { |
| 203 | var response = new StringBuilder(); |
| 204 | if (firstName != null && age != null) { |
| 205 | response.append(firstName).append("=").append(age); |
| 206 | } |
| 207 | var status = response.length() > 0 ? OK : I_AM_A_TEAPOT; |
| 208 | |
| 209 | return ResponseEntity.status(status).body(response.toString()); |
| 210 | } |
| 211 | } |