Our mobile application uses a POST request to check its status. We need to migrate this service to new location. We have released new version of the mobile application using new endpoint. And I planned to release update of the service that redirects the client to new location.
@RequestMapping(value = "/url", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
public void performHandShake(HttpServletResponse response) throws IOException {
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", service.getNewUrl());
}
I am testing this service with Postman and current Android implementation and they both fail on HTTP error 405 - method not allowed. It seems that they both redirect to GET instead of requested POST. Is there any proper way to redirect the POST request? I do not want to implement a proxy to the new endpoint.