Announcement Announcement Module
Collapse
No announcement yet.
HTTP Header Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTP Header

    Hi @all,

    is there a possibilty to add http header informations to a get request?

    Thanks for any advice!

  • #2
    Re: HTTP Header

    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/s...o-request.html

    Perry Hoekstra

    Comment


    • #3
      thanks for the advice. I found out another solution that seems to work:

      Code:
      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);

      Comment

      Working...
      X