Lasso Soft Inc. > Home

[ curl ]

Type

[curl] enables the transfer of data with URL syntax. It supports DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMTP, SMTPS, TELNET and TFTP.

[curl] supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos...), file transfer resume, proxy tunneling and many other useful tricks.

* As of Lasso 9.2.6 the curl type can be initialized with -username and -password parameters.

  • Syntax
  • Methods
  • Traits
curl('url string')

curl('url string',-username='username',-password='password')*

* Valid as of Lasso 9.2.6
Has methods:
Examples
  • Beginner

To obtain the HTML output of a URL from a remote server and evaluate the size:

Use the [curl] method. The contents of the generated output is returned to the local variable.

Code

local(obj = curl('http://www.lassosoft.com/'))
'http://www.lassosoft.com/ has size: '+string(#obj)->size

Result

http://www.lassosoft.com/ has size: 12220

To obtain the directory listing of a URL from a FTP server.

Use the [curl] method. The contents of the generated output is returned to the local variable.

Code

local(c = curl('ftp://ftp.sunet.se/pub/etext/'))
#c->result

Result

drwxrwxr-x    2 1137       1100            32768 Nov 29  1998 Atte
drwxrwxr-x    2 1137       1100            32768 Mar 16  2010 Finnish
lrwxrwxrwx    1 1137       1100                9 Sep 13 10:10 etext -> doc/etext
drwxrwsr-x   31 1137       1100            32768 Feb 12 11:56 gutenberg
drwxrwxr-x    2 1137       1100            32768 Nov  8  1998 hwb
drwxrwxr-x   10 1137       1100            32768 Jan 15  2002 libellus
drwxrwxr-x    2 1137       1100            32768 Sep  8  1999 mh
drwxrwxr-x    8 1137       1100            32768 Mar 14  2000 ota
drwxrwxr-x   12 1137       1100            32768 Oct 27  1996 runeberg
drwxrwxr-x    9 1137       1100            32768 Jan 15  2002 wiretap-classic-library

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2014 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft