Bonjour,
je suis débutante sur angular2 , je veux moudifier la table "User" mais je je rencontre un erreur "Required String parameter 'resp' is not present"
j'utilise Spring MVC pour développer des Web Services
@RequestMapping(value="/update", method = {RequestMethod.GET,RequestMethod.POST})around @ResponseStatus(value=HttpStatus.OK)around public @ResponseBody User updateUser(around @RequestParam(value="resp") String resp){around User user=new User();around userRepository.update(user);around return user;around }
et voila l'invocation du web service coté angular :
updateUsers(user:Users){around var data=JSON.stringify({resp: "abc"});around var headers = new Headers();around headers.append('Content-Type', 'application/json');around this.http.post('http://localhost:8080/rest-ws/api/update', data, { headers: headers })around .map(res=> res.json()).subscribe(res => {around var result = res;around console.log("result : ",result);around });around around}
Voila je rencontre un petit problème avec mon code.
Required String parameter 'resp' is not present. quand je clique sur bouton enregistrer.
aidez moi svp
Merci