Hi,
I am trying to consume a webservice in Spring from my application codename.
It returns the following error:
{"timestamp": 1584914466134, "status": 400, "error": "Bad Request", "exception": "org.springframework.web.bind.MissingServletRequestParameterException", "message": "Required Long parameter 'id' is not present "," path ":" / visit / start "}
I imagine it is trivial, but so far I have not been able to correct it.
My calla in Codenameone
public static Response inicio(Visita v) {
Response<String> r = Rest.post(SERVER_URL + "visita/inicio").
header("token", UsuarioService.getToken()).
jsonContent().
queryParam("id", Long.toString(v.visitaId.get())).
queryParam("fecha", Long.toString(System.currentTimeMillis())).
getAsString();
return r;
}
My Webservice
@RequestMapping(method = RequestMethod.POST,value = "/inicio")
public @ResponseBody String inicioVisita(
@RequestHeader(name="token", required = true) String token,
@RequestParam(value="id", required = true) Long id,
Long fecha) {
visitas.inicioVisita(token, id, fecha);
return "OK";
}