Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>As Sean Carpenter said, <a href="http://www.wireshark.org/" rel="nofollow noreferrer">Wireshark</a> is the right tool to view network traffic. Start a capture and use <code>http</code> as a filter to see only HTTP traffic. If you just want to see HTTP requests/responses sent/received by Curl, set the CURL_VERBOSE option and look at stderr: <code>curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L)</code>.</li> <li>I believe you are using Curl correctly. Compile and run the following (complete) example; you will see that, <em>the second time</em> you run it (when <code>cookies.txt</code> exists) cookies are sent to the server.</li> </ol> <p>Example code:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;curl/curl.h&gt; int main() { CURL *curl; CURLcode success; char errbuf[CURL_ERROR_SIZE]; int m_timeout = 15; if ((curl = curl_easy_init()) == NULL) { perror("curl_easy_init"); return 1; } curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); curl_easy_setopt(curl, CURLOPT_TIMEOUT, long(m_timeout)); curl_easy_setopt(curl, CURLOPT_URL, "http://www.google.com/"); curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)"); curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt"); curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt"); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L); if ((success = curl_easy_perform(curl)) != 0) { fprintf(stderr, "%s: %s\n", "curl_easy_perform", errbuf); return 1; } curl_easy_cleanup(curl); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload