in reply to No more 302 error, just no cookie info with POST?
in thread LWP, extract_cookies, etc.

It is hard to say what is wrong. You should try to turn on debug output in LWP::UserAgent. See LWP::Debug. For example if you add following code into your script it will turn on all debug prints inside LWP::UserAgent.
use use LWP::Debug qw(+);
Particullary you will be able to see all redirects and all headers. It will show you if you do recieve cookie in response for first request and if it sent back later in second request.

--
Ilya Martynov (http://martynov.org/)

Replies are listed 'Best First'.
LWP debug -- Not proxied??
by inblosam (Monk) on May 23, 2002 at 04:47 UTC
    I turned on LWP debug and the only thing that seems like an error is this:

    LWP::UserAgent::_need_proxy: Not proxied


    Is that the problem why my POST is not POSTing? Or is there something else to look for in the debug results? THANKS!!

    Michael Jensen
    michael at inshift.com
    http://www.inshift.com
      I found this node discussing the WinProxy. I know the box I am trying to POST to runs IIS (blah). Could this help me? How do I insert this into the header, if so? Below is an excerpt about winproxy I found. see full node 56141
      GET /index.html HTTP/1.0 Host: www.google.com

      Now this works on virtually every proxy. Except WinProxy. WinProxy requires an additional header, as well as browser identification, so the same request would look like this:
      GET / HTTP/1.0 Host: www.google.com User-agent: Mozilla/4.7 Remote-Host-Wp: 10.0.3.82

      Any help would be greatly appreciated!!

      Michael Jensen
      michael at inshift.com
      http://www.inshift.com
        I don't think your problem is releated to headers. Anyway you can add any header to the request using following code
        $request->header(Header => 'Value');
        In you code you will have to replace
        $ua->request(POST ...);
        with
        my $request = POST ...; $request->header(Header => 'Value'); ... $us->request($request);
        BTW you don't have to insert header User-agent. LWP sends it itself. See documentation for method agent in LWP::UserAgent.

        P.S. Post full debug logs here. Maybe you have overlooked anything important there.

        --
        Ilya Martynov (http://martynov.org/)