Menu

Disable user-agent header?

Help
Anonymous
2004-08-16
2004-08-17
  • Anonymous

    Anonymous - 2004-08-16

    Can the user-agent header be disabled?

    I need to find a way to disable the user agent header so that I can recreate an issue I'm seeing on a production server.

    A few experiments have failed - the most obvious, after looking at the api, was:
            wc.getClientProperties().getDefaultProperties().setUserAgent(null);
    wc.getClientProperties().setUserAgent(null);

    I still get a user agent header, with the value: httpunit/1.5

    Any way to do this?

     
    • Sergio Lissner

      Sergio Lissner - 2004-08-17

      Hi

      You can set userAgent as showed there:

           WebRequest req  = .....
           req.setHeaderField("User-Agent", "new-user-agent");

       

Log in to post a comment.

MongoDB Logo MongoDB