Code: Select all
class predicates
http_simple_next : vPcURL::connectionReturnHandlerP.
clauses
http_simple() :- % http simple download
C1 = vPcURL::new(http_simple_next),
C1:curl_easy_setopt(cURLOPT_URL, s("http://192.168.178.24/tkal2009.css")),
C1:curl_easy_perform().
http_simple_next(_Returncode, Conn) :-
Content = Conn:getOutput(),
stdIO::write("\n",Content).
Code: Select all
class predicates
http_simple_next : vPcURL::connectionReturnHandlerP.
clauses
http_simple() :- % http simple download
C1 = vPcURLforeground::new(http_simple_next),
C1:curl_easy_setopt(cURLOPT_URL, s("http://192.168.178.24/tkal2009.css")),
C1:curl_easy_perform().
http_simple_next(_Returncode, Conn) :-
Content = Conn:getOutput(),
stdIO::write("\n",Content).
Curl debug output can be caught by setting C1:setDebugOn() and DebugInfo = Conn:getDebugOutput(). Debug output also contains protocol header info.
This header info can also be retrieved separately by C1:setHeadersOn() and HeaderInfo = Conn:getHeadersOutput().
More sophisticated (binary upload/download, cascaded requests, http posting, etc.) examples are included.
What can Curl do?
Curl is an Internet protocol handler and is also able to do authentication. Secure connections e.g. https are also supported.
For the moment I would like to refer to the examples package and to the Curl website: http://curl.haxx.se/.
VPcURL supports all curl features, a number of them is in my opinion deprecated by the added VIP features, especially multithreading (use of curl-multi is disencouraged). The required Windows binaries (dll's) can be downloaded from the download page: http://curl.haxx.se/download.html.
Have fun!