I've created a GET service to redirect to a webpage that uses POST.
I'm trying to use restTemplate
because with this I can send the body and header that request the service and I've achieved to get the information that a I need from the service.
However, I need to redirect to the server that has the POST service, but I couldn't, because I don't know how can a set the status code which I redirect to another server.
These are the functions that I'm using:
RequestEntity<Object> req = new RequestEntity<Object>(body, httpHeaders, HttpMethod.POST, url);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.POST, req, String.class);