Getting data from a secure web page

Trevor DeVore lists at
Wed Feb 3 20:19:34 EST 2010

On Feb 3, 2010, at 7:40 PM, Sarah Reichelt wrote:

> Trevor, I downloaded your framework and got the modified libURL, but
> the stack won't open - it says it is corrupt. I wonder is this due to
> the multi-dimensional arrays stored as custom properties bug?
> I opened the stack in a text editor and copied the scripts into a new
> stack and tried using it instead, but not even a basic "get" worked
> then, so I can't have done that right.

The custom version of libURL is actually a plain text document. Here  
are the instructions for installing it:

This version of libURL will also handle cookies for you seamlessly.

> So a few questions for Trevor:
> - is there a version of your libURL that opens in Rev 4.0 or 4.5?
> - how do I make it the default instead of the current one?

See instructions.

> - how do I set up the callback? I am familiar with using callbacks for
> the asynchronous FTP commands but then I create a handler that gets
> the callback message and processes it. What do I need to do in this
> callback handler to make it follow the redirect?

libURLSetFollowRedirectCallback registers a callback:

libURLSetFollowRedirectCallback pMessage, pObject

Just pass the name of the message that should be sent and the long id  
of the object the message should be sent to. If no object is specified  
then it is assumed the callback message is in the message path.

 From the callback you should return "redirect" if you would like to  
try the POST again using new url. Return "get" if you want to GET the  
contents of the new URL. Return anything else to let libURL do what it  
would normally do.

libURLSetFollowRedirectCallback "RedirectRequestCallback", the long id  
of stack "MyStack"

command RedirectRequestCallback pMethod, pURL, pStatusCode, pRedirectURL
     -- return "redirect" or "get" or empty
end RedirectRequestCallback

Trevor DeVore
Blue Mango Learning Systems
Releasable Revolution Resources for Developers:

More information about the Use-livecode mailing list