opts: added two examples
This commit is contained in:
Родитель
ad90a9d9d1
Коммит
66fa069f1b
|
@ -5,7 +5,7 @@
|
||||||
.\" * | (__| |_| | _ <| |___
|
.\" * | (__| |_| | _ <| |___
|
||||||
.\" * \___|\___/|_| \_\_____|
|
.\" * \___|\___/|_| \_\_____|
|
||||||
.\" *
|
.\" *
|
||||||
.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
.\" * Copyright (C) 1998 - 2014, 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
.\" *
|
.\" *
|
||||||
.\" * This software is licensed as described in the file COPYING, which
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
.\" * you should have received as part of this distribution. The terms
|
.\" * you should have received as part of this distribution. The terms
|
||||||
|
@ -42,7 +42,21 @@ CURL_TIMECOND_NONE (0)
|
||||||
.SH PROTOCOLS
|
.SH PROTOCOLS
|
||||||
HTTP, FTP, RTSP, and FILE
|
HTTP, FTP, RTSP, and FILE
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
TODO
|
.nf
|
||||||
|
CURL *curl = curl_easy_init();
|
||||||
|
if(curl) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
|
/* January 1, 2020 is 1577833200 */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
|
||||||
|
|
||||||
|
/* If-Modified-Since the above time stamp */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||||
|
|
||||||
|
/* Perform the request */
|
||||||
|
curl_easy_perform(curl);
|
||||||
|
}
|
||||||
|
.fi
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
Always
|
Always
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
.\" * | (__| |_| | _ <| |___
|
.\" * | (__| |_| | _ <| |___
|
||||||
.\" * \___|\___/|_| \_\_____|
|
.\" * \___|\___/|_| \_\_____|
|
||||||
.\" *
|
.\" *
|
||||||
.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
|
.\" * Copyright (C) 1998 - 2014, 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
.\" *
|
.\" *
|
||||||
.\" * This software is licensed as described in the file COPYING, which
|
.\" * This software is licensed as described in the file COPYING, which
|
||||||
.\" * you should have received as part of this distribution. The terms
|
.\" * you should have received as part of this distribution. The terms
|
||||||
|
@ -36,7 +36,21 @@ since 1 Jan 1970, and the time will be used in a condition as specified with
|
||||||
.SH PROTOCOLS
|
.SH PROTOCOLS
|
||||||
HTTP, FTP, RTSP, and FILE
|
HTTP, FTP, RTSP, and FILE
|
||||||
.SH EXAMPLE
|
.SH EXAMPLE
|
||||||
TODO
|
.nf
|
||||||
|
CURL *curl = curl_easy_init();
|
||||||
|
if(curl) {
|
||||||
|
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
|
||||||
|
|
||||||
|
/* January 1, 2020 is 1577833200 */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
|
||||||
|
|
||||||
|
/* If-Modified-Since the above time stamp */
|
||||||
|
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
|
||||||
|
|
||||||
|
/* Perform the request */
|
||||||
|
curl_easy_perform(curl);
|
||||||
|
}
|
||||||
|
.fi
|
||||||
.SH AVAILABILITY
|
.SH AVAILABILITY
|
||||||
Always
|
Always
|
||||||
.SH RETURN VALUE
|
.SH RETURN VALUE
|
||||||
|
|
Загрузка…
Ссылка в новой задаче