Skip to main content

Posts

Showing posts from July, 2017

[curl] Download URL to file

cURL provides two kinds of interface to access the internet: easy and multi . Easy interface is synchronous and efficient. The multi interface has asynchronous method also multi-file data transfer ability. In this tutorial, we are going to demonstrate how to simply download an HTTP file from internet with cURL easy method in C++ . Easy interface Let’s talk about the easy interface, steps for data transfer purpose can be separated into three. curl_easy_init() Initialization an easy-session and get a handle. The handle will be used as an input for the following functions. curl_easy_setopt() Setting all the options you want for the internet data transfer including URL, port or the way to write data. curl_easy_perform() After the options you want for the upcoming transfer has been settled. you can call the curl_easy_perform() function. It will do the entire job and won’t return until the job has been done or failed. curl_easy_cleanup() After the job has be...

[curl] Useful Curl learning information

Here listed some useful resources for curl learning. curl.haxx.se The latest development of curl will can be find on curl website. Package can be download from this site, too. Everything curl If you want to find more detail information of curl, Everything curl will be a helpful resource for you. curl Sample codes For a good start, sample codes can be download from: https://curl.haxx.se/libcurl/c/example.html Good luck!

[curl]First curl program with Code::Block

Code::Block is tiny powerful cross-platform IDE for C/C++ program. However, the pre-installed complier is 32-bit. Both curl and openSSL is needed in this tutorial. Hence, it is really important to make sure if they are also installed accordingly. Compiler of your Code::Block can be check from: Setting>Toolchan executables It shows that the compiler is located at C:\MinGW and it is Win32 based. Both Curl and openSSL need to be download for this tutorial.It is highly recommended to install all the program with win32 version!! 1. Download and install the openSSL openSSL can be download from this location. https://slproweb.com/products/Win32OpenSSL.html In this demo, full version of v1.1 is installed. The openSSL folder will be located at C:\OpenSSL-Win32 2. Download and install curl You can find the guideline to setup curl properly from previous article. Just need to remind again that Win32 version is needed in this case. https://aconcaguac...

[curl] how to install curl on windows

How to install Curl on windows Curl is a universal library and command-line tool for data transferring with various common protocols. The protocols including DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, Telnet and TFTP. Curl also supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, HTTP/2, cookies, user+password authentication (Basic, Plain, Digest, CRAM-MD5, NTLM, Negotiate and Kerberos), file transfer resume, proxy tunneling and more. However, Curl is not preinstalled in the windows system. But it can be easily build up in your windows system followed by these few steps. 1. Download curl from internet Connect to https://curl.haxx.se and click on download . 2. Download the curl package Please choose the package that suit for your system. In this demonstration, I used the version 7.54.1 provided by Viktor Szakáts . 3. Unzip the file an...