I need to send a request as following
http://server.com/server1/index.php?id=123&name=jack&date=12.1.2016
I am using following code but it seems like it does not send a correct request as response object is empty. I am also wondering how to show the complete url that restTemplate is sending? I know WireShark can be used but is there any way to retrieve it using restTemplate?
Code
String url = "http://server.com/server1/index.php?"
Map<String,String> vars = new HashMap<String,String>();
vars.put("id","123");
vars.put("name","jack");
vars.put("date","12.1.2016");
Profile profile = restTemplate.getForObject(url,Profile.class,vars);
You can set the Log Level for
org.springframework.web.client.RestTemplate
to debug then you'll get an output similar to this:There you can see the Request the URL and the returned HTTP Status code.
If you are using Logback xml configuration you would write