任何人都知道一種方法可以從Curl文章中刪除此...?libcurl POST,刪除由Curl引發的額外數據
" method="post" name="form_reply" enctype="multipart/form-data">
它被固定在郵件的POST行上。即...
POST /someurl/Topic/comment/replycreate/27537?sp=1**" method="post" name="form_reply" enctype="multipart/form-data">** HTTP/1.1
在此先感謝...!
OK,更多信息... BTW:這是C,而不是PHP
CURL *curl;
CURLcode result;
char errorBuffer[CURL_ERROR_SIZE];
int status=FALSE;
BufHandle *Bufhandle = CreateBufHandle(BUFSIZE);
memset(&errorBuffer,0x0,sizeof(errorBuffer));
curl = curl_easy_init();
if(curl)
{
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, GetPtrToSlist(S));
curl_easy_setopt(curl, CURLOPT_HEADER, 0);
curl_easy_setopt(curl, CURLOPT_USERAGENT, GetParameterByName(S, "useragent"));
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, GetParameterByName(S, "cookiefile"));
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, GetParameterByName(S, "cookiefile"));
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &errorBuffer);
curl_easy_setopt(curl, CURLOPT_ENCODING , "gzip");
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30);
curl_easy_setopt(curl, CURLOPT_PROXY, "");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
//curl_easy_setopt(curl, CURLOPT_RETURNTRANSFER, 1);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_POST, 1);
//curl_easy_setopt(curl, CURLOPT_USERPWD, buf);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)Bufhandle);
result = curl_easy_perform(curl);
curl_slist_free_all(GetPtrToSlist(S));
curl_easy_cleanup(curl);
if(result == CURLE_OK)
{
status = TRUE;
}
else
{
printf("Error: [%d] - %s\n",result, errorBuffer);
status = FALSE;
}
}
你顯然使用API錯誤,但是這是沒有足夠的信息相關的代碼可能。 – 2010-12-16 03:03:17
「你顯然使用API錯誤,但是這個信息不夠。相關的代碼可能會有幫助。 - Matthew Flaschen「請隨時使用CORRECT API給我啓發 – chinasailor 2010-12-16 04:27:40