ho questo controllore in primaveraPrimavera REST richiesta di controllo posta
@RestController
public class GreetingController {
@RequestMapping(value = "/greeting", method = RequestMethod.POST)
public String greeting(@RequestParam("uouo") String uouo) {
return uouo;
}
}
e quando ho testarlo
curl -k -i -X POST -H "Content-Type:application/json" -d uouo=test http://192.168.1.104:8080/api/greeting
il risultato del test
stato HTTP 400 - Parametro Obbligatorio String ' uouo 'non è presente
Ho provato qualcosa, ma penso che @RequestParam
non può essere usato per POST ha sempre passato il parametro in URL usando GET, io uso post solo se ho avuto oggetto JSON come parametro usando @RequestBody
, c'è un modo per far inviare parametri stringa usando POST?