117
116
/* First set the URL that is about to receive our POST. */
118
curl_easy_setopt(curl, CURLOPT_URL, URL);
117
test_setopt(curl, CURLOPT_URL, URL);
120
119
/* Now specify we want to POST data */
121
curl_easy_setopt(curl, CURLOPT_POST, 1L);
120
test_setopt(curl, CURLOPT_POST, 1L);
123
122
/* Set the expected POST size */
124
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
123
test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)pooh.sizeleft);
126
125
/* we want to use our own read function */
127
curl_easy_setopt(curl, CURLOPT_READFUNCTION, read_callback);
126
test_setopt(curl, CURLOPT_READFUNCTION, read_callback);
129
128
/* send a multi-part formpost */
130
curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
129
test_setopt(curl, CURLOPT_HTTPPOST, formpost);
132
131
/* get verbose debug output please */
133
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
132
test_setopt(curl, CURLOPT_VERBOSE, 1L);
135
134
/* include headers in the output */
136
curl_easy_setopt(curl, CURLOPT_HEADER, 1L);
135
test_setopt(curl, CURLOPT_HEADER, 1L);
138
137
/* Perform the request, res will get the return code */
139
138
res = curl_easy_perform(curl);
141
142
/* always cleanup */
142
143
curl_easy_cleanup(curl);
143
144
curl_global_cleanup();