I have 2 spring boot based java app .
In one of the controller i am redirecting to call to second app but second app is also expecting some request headers. How can i add requestheaders to redirect uri.
public @ResponseBody ResponseEntity<?> testMethod(@RequestHeader("User-Agent") String userAgent){
HttpHeaders headers = new HttpHeaders();
// validating request .if success
headers.set("test-header", "value");
URI uri = new URI("http://localhost:8083/test1");
headers.setLocation(uri);
return new ResponseEntity<String>(headers,HttpStatus.FOUND);
}
but in the second app i don't see headers coming in . Is there a way to redirect with http headers.
Please help me out.