View Full Version : HTTP Header
Jan 7th, 2011, 03:44 AM
is there a possibilty to add http header informations to a get request?
Thanks for any advice!
Jan 10th, 2011, 08:47 AM
Yes, but not easily. As I understand it, RestTemplate won't have access to the HTTP headers until Spring 3.1
In the meantime, I would point you at Christian Tzolov's workaround that is found here: http://tzolov.blogspot.com/2010/03/spring-3-resttemplate-access-to-request.html
Jan 10th, 2011, 03:01 PM
thanks for the advice. I found out another solution that seems to work:
RestTemplate template = new RestTemplateWrapper(requestFactory);
URI url = new URI("URI");
HttpEntity<Object> entity = new HttpEntity<Object>(MultiValueMap headerinfo);
ResponseEntity<String> result = template.exchange(url, HttpMethod.GET, entity, String.class);
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.