ScriptBasic > Tutorials

cURL Example

(1/1)

Support:
The following cURL extension module example retrieves a web page HTML and saves it to your PC. (webget)


--- Code: ---' cURL webget

INCLUDE curl.bas

ch = curl::init()
curl::option(ch,"URL","http://scriptbasic.com/html/general.html")
curl::option(ch,"FILE","general.html")
curl::perform(ch)
curl::finish(ch)

--- End code ---

cURL extension module documentation


Here is a webget by opening a TCP socket using ScriptBasic.


--- Code: ---OPEN "scriptbasic.com/html/general.html:80" for SOCKET AS #1
PRINT #1,"GET http://localhost/ HTTP/1.0\n\n"
WHILE NOT EOF(1)
  LINE INPUT #1, content
  PRINT content
WEND
CLOSE(1)

--- End code ---

Navigation

[0] Message Index

Go to full version