This section describes http-related parameters in curl_easy_setopt. Note that this section describes libcurl as the subject and others as the object.
1. curlopt_url
Set access URL
2. curlopt_writefunction, curlopt_writedata
The callback function is prototype: size_t function (void * PTR, size_t size, size_t nmemb, void * stream). The function will be called after libcurl receives data, therefore, functions do more data storage functions, such as processing downloaded files. Curlopt_writedata is used to indicate the source of the stream pointer in the curlopt_writefunction function.
3. curlopt_headerfunction, curlopt_headerdata
The prototype of the callback function is size_t function (void * PTR, size_t size, size_t nmemb, void * stream). Once the libcurl receives the HTTP header data, it will call this function. Curlopt_writedata passes the pointer to libcurl, which indicates the source of the stream pointer of the curlopt_headerfunction.
4. curlopt_readfunction curlopt_readdata
When libcurl needs to read data and pass it to the remote host, it will call the function specified by curlopt_readfunction. The function prototype is size_t function (void * PTR, size_t size, size_t nmemb, void * stream ). curlopt_readdata indicates the stream pointer source in the curlopt_readfunction prototype.
5. curlopt_noprogress, curlopt_progressfunction, curlopt_progressdata
Parameters related to the data transmission progress. The function specified by curlopt_progressfunction is normally called by libcurl every second. To make curlopt_progressfunction called, the parameter must be set to false. The parameter specified by curlopt_progressdata will be the first parameter of the function specified by curlopt_progressfunction.
6. curlopt_timeout, curlopt_connectiontimeout:
Curlopt_timeout: Because the transmission time is set, curlopt_connectiontimeout sets the connection wait time.
7. curlopt_followlocation
Set relocation URL
Curlopt_range: curlopt_resume_from:
Resumable upload settings. Curlopt_range specifies that the char * parameter is passed to libcurl to specify the range header of the HTTP domain, for example:
Indicates the first 500 Bytes: bytes = 0-499
Indicates the second 500 Bytes: bytes = 500-999
Indicates the last 500 Bytes: bytes =-500
Indicates the range after 500 Bytes: bytes = 500-
First and last Bytes: bytes = 0-0,-1
Specify the following ranges: bytes = 500-600,601-999.
Curlopt_resume_from transmits a long parameter to libcurl, specifying
Offset.