summaryrefslogtreecommitdiff
path: root/docs/examples/getinfo.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-06-24 23:34:51 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-06-24 23:34:51 +0200
commitf87a3d736f3200029c8bed3ab4dad50f9680be7a (patch)
tree7db1fde8016a6f576d7cba006365f461aaee00d0 /docs/examples/getinfo.c
parentbf5218c85eba8d13c6c40a8047b8018b4ff5f1ed (diff)
parentf44b803f1605edcfc4058b1a818c44552f0affec (diff)
downloadcurl-http2-push.tar.gz
Merge branch 'master' into http2-pushhttp2-push
Diffstat (limited to 'docs/examples/getinfo.c')
-rw-r--r--docs/examples/getinfo.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/docs/examples/getinfo.c b/docs/examples/getinfo.c
index acbe1e1af..7f578df43 100644
--- a/docs/examples/getinfo.c
+++ b/docs/examples/getinfo.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -19,6 +19,10 @@
* KIND, either express or implied.
*
***************************************************************************/
+/* <DESC>
+ * Use getinfo to get content-type after completed transfer.
+ * </DESC>
+ */
#include <stdio.h>
#include <curl/curl.h>
@@ -27,18 +31,14 @@ int main(void)
CURL *curl;
CURLcode res;
- /* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
curl = curl_easy_init();
if(curl) {
- /* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
- /* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
res = curl_easy_perform(curl);
if(CURLE_OK == res) {
char *ct;
/* ask for the content-type */
- /* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
if((CURLE_OK == res) && ct)
@@ -46,7 +46,6 @@ int main(void)
}
/* always cleanup */
- /* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
curl_easy_cleanup(curl);
}
return 0;