heres an article which explains howto:

http://blogs.sun.com/enterprisetechtips/entry/consuming_restful_web_services_with

<http://blogs.sun.com/enterprisetechtips/entry/consuming_restful_web_services_with>Essentially
it's this part:


Code that issues a get request:

   public List<StatusBean> getFriendsTimelineJson() {
           return wr.path("statuses/friends_timeline.json")
                   *.header(AUTHENTICATION_HEADER, authentication)*
                   .accept(MediaType.APPLICATION_JSON_TYPE)
                   .get(new GenericType<List<StatusBean>>() {
           });
    }

Notice the addition of an Authentication header to the request.


-regards Nino

2011/2/19 Moandji Ezana <[email protected]>

> Would it be sufficient to wrap the request in an HttpServletRequestWrapper
> that overrides getMethod() based on the header?
>
> Moandji
>
> --
> www.moandjiezana.com
>
> Sent from my phone
> On 4 Feb 2011 01:08, "ukpylot" <[email protected]> wrote:
> > I have a Java app that uses Guice for injection and for starting up an
> > embedded Jetty instance that receives HTTP requests that are handled
> > by Jersey. Some of my requests are PUTs and DELETEs but the client
> > technology being used can only send GETs and POSTs. In a previous
> > application that was straight Tomcat/Jersey I got round this by
> > letting the client set an "X-HTTP-Method-Override" header and
> > implementing a ContainerRequestFilter as described here:
> >
> http://zcox.wordpress.com/2009/06/17/override-the-http-request-method-in-jersey/
> >
> > So now I am looking to do the same thing with Guice but don't really
> > know where to start. Hopefully someone can point me in the right
> > direction but in the meantime I'll creep over the source to see where
> > I might do this.
> >
> > Thanks for any help.
> >
> > Paul.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected].
> > For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to