I have a building block using Spring MVC.
The controller looks like this:
@RequestMapping(value = "/addUpdateUser",method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public String getAddUpdateUser(HttpServletRequest request) {
String xml = request.getParameter("xml");
....
When I call this from my application like this:
URI url = new URI(baseUrl+"/users/addUpdateUser");
HttpClient httpclient = HttpClients.createDefault();
HttpPost httppost = new HttpPost(url);
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
it fails... I get a web page saying that I do not have access to this page, but If I change the code to a HttpGet like this:
URI url = new URI(baseUrl+"/users/addUpdateUser");
HttpClient httpclient = HttpClients.createDefault();
HttpGet httpget = new HttpGet(url);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
It works fine....
Why cant I do a POST to a blackboard Buildingblock?