"Doug Monroe" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Rob Dixon wrote: > > > > Hi > > > > Could somebody tell me which URL should be used in > > the Referer header when a link is followed from a > > document which is the result of one or more redirections? > > Is it the original document that was requested or the final > > one which comes with a success status code? Also, is there > > any part of LWP which will enter the correct header value > > for me? > > referer should be the step-before-last
Not clear what you're meaning here Doug. surely not the URL of the last-but-one HTML document? > from past lwp list thread of Thu, 14 Mar 2002 > > TIP#4 > > Sometimes you -need- to pass HTTP_REFERER data, e.g.: > > $request->referer('http://www.example.com/logon.html'); > > > > TIP#5 > > # use as needed to show/debug header info > > use LWP::Debug qw(+); > > > > TIP#6 > > Sometimes you need to follow redirects: > > # use as needed to allow LWP to follow redirects > > BEGIN { *LWP::UserAgent::redirect_ok = sub { 1 } } Another, off-topic, concern here. Adding POST to the list of redirectable either as above or with: push @{ $ua->requests_redirectable }, 'POST'; results in a POST request to the new URL in the Location header. Browsers I've come across use a GET in this situation. Any comment Gisle? Cheers, Rob