1CURLOPT_NOBODY(3)          curl_easy_setopt options          CURLOPT_NOBODY(3)
2
3
4

NAME

6       CURLOPT_NOBODY - do the download request without getting the body
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_NOBODY, long opt);
12

DESCRIPTION

14       A long parameter set to 1 tells libcurl to not include the body-part in
15       the output when doing what would otherwise be a download. For  HTTP(S),
16       this makes libcurl do a HEAD request. For most other protocols it means
17       just not asking to transfer the body data.
18
19       Enabling this option means asking for a download but without a body.
20

DEFAULT

22       0, the body is transferred
23

PROTOCOLS

25       Most
26

EXAMPLE

28       curl = curl_easy_init();
29       if(curl) {
30         curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
31
32         /* get us the resource without a body! */
33         curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
34
35         /* Perform the request */
36         curl_easy_perform(curl);
37       }
38

AVAILABILITY

40       Always
41

RETURN VALUE

43       Returns CURLE_OK
44

SEE ALSO

46       CURLOPT_HTTPGET(3), CURLOPT_POST(3), CURLOPT_REQUEST_TARGET(3),
47
48
49
50libcurl 7.61.1                   June 21, 2017               CURLOPT_NOBODY(3)
Impressum