Loading ...
Sorry, an error occurred while loading the content.
 

setting User-Agent

Expand Messages
  • nitty111
    How do I set the User-Agent in the header? With +trace for debugging I can see that Content-Length and Content-Type were set but not the User-Agent.
    Message 1 of 3 , Feb 6, 2002
      How do I set the User-Agent in the header? With "+trace" for
      debugging I can see that Content-Length and Content-Type were set but
      not the User-Agent.
    • Duncan Cameron
      ... Something like this: my $s = SOAP::Lite - uri($uri) - proxy( $protocol//$server:$port$endpoint ) ; $s- transport- agent( My agent ); This sets the user
      Message 2 of 3 , Feb 7, 2002
        On 2002-02-07 nitty111 wrote:
        >How do I set the User-Agent in the header? With "+trace" for
        >debugging I can see that Content-Length and Content-Type were set but
        >not the User-Agent.
        Something like this:

        my $s = SOAP::Lite
        -> uri($uri)
        -> proxy("$protocol//$server:$port$endpoint")
        ;
        $s->transport->agent('My agent');

        This sets the user agent directly in the LWP::UserAgent object, whereas
        the trace is showing the HTTP::Request object.

        Regards
        Duncan Cameron
      • Paul Kulchenko
        Hi, Duncan! ... That s correct. This will also work: my $s = SOAP::Lite - uri($uri) - proxy( $protocol//$server:$port$endpoint , agent = My agent ); Best
        Message 3 of 3 , Feb 7, 2002
          Hi, Duncan!

          --- Duncan Cameron <dcameron@...> wrote:
          > Something like this:
          >
          > my $s = SOAP::Lite
          > -> uri($uri)
          > -> proxy("$protocol//$server:$port$endpoint")
          > ;
          > $s->transport->agent('My agent');
          >
          > This sets the user agent directly in the LWP::UserAgent object,
          > whereas the trace is showing the HTTP::Request object.
          That's correct. This will also work:

          my $s = SOAP::Lite
          -> uri($uri)
          -> proxy("$protocol//$server:$port$endpoint", agent => 'My agent');

          Best wishes, Paul.


          __________________________________________________
          Do You Yahoo!?
          Send FREE Valentine eCards with Yahoo! Greetings!
          http://greetings.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.