Anyone familiar with Jakarta HttpClient?

Discussion in 'Java' started by ohaya, Dec 25, 2006.

  1. ohaya

    ohaya Guest

    Hi,

    I was wondering if anyone here might be familiar with Jakarta HttpClient:

    http://jakarta.apache.org/commons/httpclient/

    I want to find out if it is possible to set one of the HttpClient
    "preferences" non-programatically. In particular, I need to set the
    "http.protocol.single-cookie-header" to true.

    The reason for my question is that I'm working with an application that
    uses HttpClient, and the application appears to be sending multiple
    "Cookie:" HTTP headers, and I need to configure the app to combined
    these "Cookie:" headers into a single "Cookie:" header.

    I've posted on the HttpClient users mailing list a couple of days ago,
    with no response, and can't seem to subscribe to the HttpClient
    developers list, so I'm hoping that someone here might be able to help.

    Thanks in advance!!

    Jim
    ohaya, Dec 25, 2006
    #1
    1. Advertising

  2. ohaya wrote:
    > I want to find out if it is possible to set one of the HttpClient
    > "preferences" non-programatically. In particular, I need to set the
    > "http.protocol.single-cookie-header" to true.
    >

    Not sure what you mean by non-programatically. You can either put the
    name-value pairs in a properties file (making it declarative), or have
    command line arguments drive the name-value pairs.

    -cheers,
    Manish
    Manish Pandit, Dec 25, 2006
    #2
    1. Advertising

  3. ohaya

    ohaya Guest

    Manish Pandit wrote:
    > ohaya wrote:
    >> I want to find out if it is possible to set one of the HttpClient
    >> "preferences" non-programatically. In particular, I need to set the
    >> "http.protocol.single-cookie-header" to true.
    >>

    > Not sure what you mean by non-programatically. You can either put the
    > name-value pairs in a properties file (making it declarative), or have
    > command line arguments drive the name-value pairs.



    Manish,

    Either a way to do this via a properties file or via command line would
    do.

    I've tried the latter, adding
    "-Dhttp.protocol.single-cookie-header=true" to the command line
    (actually, in Java Control Panel), and it appears in the Java Console
    debug output when I type "s", but the setting does not seem to be taking
    effect, i.e., I still see multiple "Cookie:" headers being sent.

    Is that ("http.protocol.single-cookie-header") the correct full name for
    this parameter to HttpClient?

    Jim
    ohaya, Dec 25, 2006
    #3
  4. ohaya

    ohaya Guest

    Manish Pandit wrote:
    > ohaya wrote:
    >> I want to find out if it is possible to set one of the HttpClient
    >> "preferences" non-programatically. In particular, I need to set the
    >> "http.protocol.single-cookie-header" to true.
    >>

    > Not sure what you mean by non-programatically. You can either put the
    > name-value pairs in a properties file (making it declarative), or have
    > command line arguments drive the name-value pairs.



    Manish,

    Either a way to do this via a properties file or via command line would
    do.

    I've tried the latter, adding
    "-Dhttp.protocol.single-cookie-header=true" to the command line
    (actually, in Java Control Panel), and it appears in the Java Console
    debug output when I type "s", but the setting does not seem to be taking
    effect, i.e., I still see multiple "Cookie:" headers being sent.

    Is that ("http.protocol.single-cookie-header") the correct full name for
    this parameter to HttpClient?

    Jim
    ohaya, Dec 25, 2006
    #4

  5. > Is that ("http.protocol.single-cookie-header") the correct full name for
    > this parameter to HttpClient?


    Thats strange...per the documentation on
    http://jakarta.apache.org/commons/httpclient/preference-api.html, the
    property name you are using seems to be correct. You might want to
    check the bug list on Apache for this issue. Alternatively, you can
    download the source code and check if this value is referenced - you
    can add the source to eclipse and debug all the way down.

    -cheers,
    Manish
    Manish Pandit, Dec 26, 2006
    #5
  6. ohaya

    ohaya Guest

    Manish Pandit wrote:
    >> Is that ("http.protocol.single-cookie-header") the correct full name for
    >> this parameter to HttpClient?

    >
    > Thats strange...per the documentation on
    > http://jakarta.apache.org/commons/httpclient/preference-api.html, the
    > property name you are using seems to be correct. You might want to
    > check the bug list on Apache for this issue. Alternatively, you can
    > download the source code and check if this value is referenced - you
    > can add the source to eclipse and debug all the way down.
    >



    Manish,

    Thanks for your reply.

    FYI, I've been on the HttpClient mailing list with Oleg, who I think is
    one of the people that works on HttpClient, and it appears that there
    isn't a way to set this particular parameter non-programatically, so I'm
    going to have to try to see if I can get the vendor to add it, probably
    as some kind of configuration option, since what I'm working with is a
    COTS product, and I don't have their source.

    Jim
    ohaya, Dec 26, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard
    Replies:
    0
    Views:
    684
    Richard
    Apr 26, 2004
  2. Alex Hunsley
    Replies:
    1
    Views:
    6,363
    Alex Hunsley
    May 28, 2004
  3. Michael Fortin
    Replies:
    1
    Views:
    5,712
    John C. Bollinger
    Oct 12, 2004
  4. Wil Hadden

    Jakarta HttpClient POST question

    Wil Hadden, Nov 8, 2004, in forum: Java
    Replies:
    11
    Views:
    3,696
    blueray
    Jul 1, 2009
  5. Rachel
    Replies:
    0
    Views:
    844
    Rachel
    Oct 17, 2005
Loading...

Share This Page