HEAD method

Thomas Fischer fischer.th at aon.at
Wed Feb 18 07:41:20 EST 2009


Hello,

I had to look into my HEAD method again, using Dave's approach at
http://lists.runrev.com/pipermail/use-revolution/2009-January/119601.html
(I don't know how to reply to this directly because I only receive the  
digests.):
on mouseUp
    libUrlFollowHttpRedirects false
    put "HEAD" && "/freebeer.html" && "HTTP/1.1" into tRequest
    put cr & "User-Agent: Revolution" after tRequest
    put cr & "Host:" && "www.runrev.com" after tRequest
    put cr & "Connection: close" after tRequest
    libURLSetCustomHTTPHeaders tRequest
    get url "http://www.runrev.com/"
    put libUrlLastRhHeaders()
    libUrlFollowHttpRedirects true ##RESET
end mouseUp
His method works, although I don't quite understand what Revolution  
does with two URLs: one in the custom header and the other from the  
call to url. The other possible problem is that the  
libUrlLastRhHeaders() function isn't reset if the call failed, this  
happened e.g. when I tried get url "". In this case the  
libUrlLastRhHeaders() will still return the same header from the last  
successful call.
Anyway, I tried to code this as a function:
on mouseUp
    breakpoint
   get theFinalHeader()
end mouseUp

function theFinalHeader
   libUrlFollowHttpRedirects false
   put "HEAD" && "/freebeer.html" && "HTTP/1.1" into tRequest
   put cr & "User-Agent: Revolution" after tRequest
   put cr & "Host:" && "www.runrev.com" after tRequest
   put cr & "Connection: close" after tRequest
   libURLSetCustomHTTPHeaders tRequest
   get url "http://www.runrev.com/"
   put libUrlLastRhHeaders()
   libUrlFollowHttpRedirects true ##RESET
   beep
end theFinalHeader

which again works, but when I try to follow the proceedings in the  
debugger,  the debugger jumps from
  get url "http://www.runrev.com/"
immediately back to the mouseUp handler, but the beep will sound.

I don't understand if this is a problem with the debugger, with the  
url call, with the headers or with my installation.
I use Revolution Media 3.0.0 Revision A, Build 750.

Does anybody have an idea?

Best regards
Thomas Fischer






More information about the use-livecode mailing list