Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] HttpClient & session management


\V/

Alex Dean <alex@xxxxxxxxxxxx> wrote:

>I'm trying to use an instance of org.eclipse.jetty.client.HttpClient to write a test case for ActiveMQ (which uses Jetty).
>
>I am able to send basic POST & GET responses.  The trouble I'm having is that I am unable to access the JESSSIONID which is returned from the server, so I can't maintain my state across multiple requests.
>
>Here's the test I've worked on : http://pastie.org/1177995
>Here's the output : http://pastie.org/1178030
>
>This code shows 2 separate ways I've tried accessing the response headers.
>  1. Implementing ContentExchange.onResponseHeader.  My callback is never called, though my other onRequestComplete and onResponseComplete callbacks are.
>  2. Trying to use ContentExchange.getResponseFields().  The returned object is null.
>
>I watched port 8080 in wireshark while my test was running, and I did see that the 'Set-Cookie' header was returned by the server. 
>http://skitch.com/alexdean/d2g2b/capturing-from-lo0-wireshark
>
>I am able to send a POST to the servlet, and I do receive a response, but without the cookie I can't associate my later requests with the subscriptions I've created in the initial POST.
>
>I can't find any documentation on how session/cookie management should work with org.eclipse.jetty.client.HttpClient.  Can anyone offer any links or tips on this subject?
>
>thanks,
>alex
>_______________________________________________
>jetty-users mailing list
>jetty-users@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/jetty-users

Back to the top