Results 1 to 3 of 3

Thread: HTTP Header

  1. #1
    Join Date
    Dec 2007
    Location
    Mainz, Germany
    Posts
    7

    Default HTTP Header

    Hi @all,

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

    Thanks for any advice!

  2. #2

    Default 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

  3. #3
    Join Date
    Dec 2007
    Location
    Mainz, Germany
    Posts
    7

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •