Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Utilities / cmcurl-7.19.0 / docs / examples / http-post.c
blobc613bb224df39d8fba9fbf0cb3ae95b9bd6c7227
1 /*****************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * $Id: http-post.c,v 1.1.1.1 2008-09-23 16:32:05 hoffman Exp $
9 */
11 #include <stdio.h>
12 #include <curl/curl.h>
14 int main(void)
16 CURL *curl;
17 CURLcode res;
19 curl = curl_easy_init();
20 if(curl) {
21 /* First set the URL that is about to receive our POST. This URL can
22 just as well be a https:// URL if that is what should receive the
23 data. */
24 curl_easy_setopt(curl, CURLOPT_URL, "http://postit.example.com/moo.cgi");
25 /* Now specify the POST data */
26 curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "name=daniel&project=curl");
28 /* Perform the request, res will get the return code */
29 res = curl_easy_perform(curl);
31 /* always cleanup */
32 curl_easy_cleanup(curl);
34 return 0;