on ‎2018 Jul 09 3:47 PM
I am creating simple method in a controller and calling from UI , it is a post method and giving error as 403. Sample UI part url : targeturl data : JSON.stringify(requestData), type : "POST", datatype : 'json', contentType:'application/json', cache : false
Sample method part @RequestMapping(value = "/method1", method = RequestMethod.POST, produces = "application/json") @ResponseBody public String method1(final DTO dto1) {}
Request clarification before answering.
Hi, you need to add CSFR token to your request. You should get the token from the server when you request the page and after that you send it back with the post request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are some description of this here : https://help.hybris.com/6.7.0/hcd/c8145542c2564bb29f6cf2fb6fe67b90.html (see under CSRF token)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.