xref: /curl/docs/libcurl/opts/CURLOPT_VERBOSE.md (revision 5a488251)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_VERBOSE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_DEBUGFUNCTION (3)
9  - CURLOPT_ERRORBUFFER (3)
10  - CURLOPT_STDERR (3)
11  - curl_global_trace (3)
12Protocol:
13  - All
14Added-in: 7.1
15---
16
17# NAME
18
19CURLOPT_VERBOSE - verbose mode
20
21# SYNOPSIS
22
23~~~c
24#include <curl/curl.h>
25
26CURLcode curl_easy_setopt(CURL *handle, CURLOPT_VERBOSE, long onoff);
27~~~
28
29# DESCRIPTION
30
31Set the *onoff* parameter to 1 to make the library display a lot of
32verbose information about its operations on this *handle*. Useful for
33libcurl and/or protocol debugging and understanding. The verbose information
34is sent to stderr, or the stream set with CURLOPT_STDERR(3).
35
36You hardly ever want this enabled in production use, you almost always want
37this used when you debug/report problems.
38
39To also get all the protocol data sent and received, consider using the
40CURLOPT_DEBUGFUNCTION(3).
41
42# DEFAULT
43
440, meaning disabled.
45
46# %PROTOCOLS%
47
48# EXAMPLE
49
50~~~c
51int main(void)
52{
53  CURL *curl = curl_easy_init();
54  if(curl) {
55    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
56
57    /* ask libcurl to show us the verbose output */
58    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
59
60    /* Perform the request */
61    curl_easy_perform(curl);
62  }
63}
64~~~
65
66# %AVAILABILITY%
67
68# RETURN VALUE
69
70Returns CURLE_OK
71