cURL / Mailing Lists / curl-library / Single Mail


Re: RE: what does curl post

From: fancy_2626 <>
Date: Fri, 26 Oct 2012 18:24:23 -0700

Hello! I still need help to make my post work.
I used CURLOPT_DEBUGFUNCTION to trace what curl post to the URL. I find after the postfields I defined, there is a strange sequence. No matter how I tweak my postfields, it is always there. I check the length of my postfields, it looks good. Any suggestion for me? Thank you so much!
Below is the information from CURLINFO_HEADER_OUT and my code.
POST /pubs/mir07/mir07_dyn_data.html HTTP/1.1
Accept: */*
Content-Length: 38
Content-Type: application/x-www-form-urlencoded


int main(void) {
int len;
CURL *curl;
CURLcode res;
static char *postthis="microRNAs=hsa-miR-9&Genes=NM_001004317";
/* get a curl handle */
curl = curl_easy_init();
if(curl) {
/* get verbose debug output please */
curl_easy_setopt(curl, CURLOPT_VERBOSE,1L);
curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
/* First set the URL that is about to receive our POST. */
curl_easy_setopt(curl, CURLOPT_URL, "");
/* Now specify we want to POST data */
curl_easy_setopt(curl, CURLOPT_POST, 1L);
/* send all data to this function */
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, postthis);
len = strlen(postthis);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, len);
/* Perform the request, res will get the return code */
res = curl_easy_perform(curl);
/* Check for errors */
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
/* always cleanup */
return 0;

发件人:Yehezkel Horowitz
发送时间:2012-10-22 01:04
主题:RE: what does curl post
收件人:"libcurl development"<>

> I wonder how I can know if curl convey the form content to the web site and what it posts.
> …My script failed to post. Any suggestion is welcome. Thanks.

The very first step you can do is to use the CURLOPT_DEBUGFUNCTION to see the whole transaction.

Yehezkel Horowitz

List admin:

List admin:
Received on 2012-10-27