Support > General Discussions

curl https

(1/3) > >>

Script_test:
Could you help me with an scriptbasic example of downloading content or access to a web site, using curl and https. (https://google.com).

ty.

Support:
Welcome to the forum!

Here is the link to the Script BASIC cURL extension module documentation.

I will try to post an example for you when I get a moment.

Script_test:

--- Code: ---Import "c:\scriptbasic\include\curl.bas"
Import "c:\scriptbasic\include\cio.bas"
on error goto CURL_ERROR_CURL

CURL = curl::init()
curl::Option CURL,"CONNECTTIMEOUT",110
curl::option CURL,"FRESH_CONNECT"
curl::option Curl,"BUFFER_SIZE",1024
curl::option CURL,"MAXREDIRS",7

curl::option CURL,"REFERER","https://www.google.com"

curl::option CURL,"USERAGENT","Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"

curl::option CURL,"COOKIEFILE","cookies.txt"

curl::option CURL,"URL","https://www.google.com"

curl::option CURL,"FILE","file.txt"

curl::perform CURL

curl::finish CURL
stop


rem ====================

CURL_ERROR_CURL:
PRINT "Some error happened while trying to download ScriptBasic home page. The error message is:\n"
PRINT curl::error()


STOP

--- End code ---


curl::option CURL,"URL","https://www.google.com"


without the https protocol works correctly but fails https (error code: (0): error &H72: Built in function has too few arguments)

could you help me please,ty

Support:
https: support is a libcurl related option. You may want to try a search for libcurll and https usage.

I'm trying to free up some time to have a closer look at this for you.

Support:
This works fine for me under Linux.


--- Code: Script BASIC ---Import curl.bas on error goto CURL_ERROR_CURL CURL = curl::init() curl::Option CURL,"CONNECTTIMEOUT",110curl::option CURL,"FRESH_CONNECT"curl::option CURL,"BUFFER_SIZE",1024curl::option CURL,"MAXREDIRS",7curl::option CURL,"REFERER","https://www.google.com"curl::option CURL,"USERAGENT","Mozilla/5.0 (Windows NT 10.0; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"curl::option CURL,"COOKIEFILE","cookies.txt"curl::option CURL,"URL","https://www.google.com"curl::option CURL,"FILE","file.txt" curl::perform CURLcurl::finish CURL stop  rem ==================== CURL_ERROR_CURL:PRINT "Some error happened while trying to download ScriptBasic home page. The error message is:\n"PRINT curl::error() STOP 

Navigation

[0] Message Index

[#] Next page

Go to full version