簡體   English   中英

c使用libcurl curl_easy_perform將帖子,空格和點替換為下划線

[英]c use libcurl curl_easy_perform post, spaces and dot replaced by underscore

c使用libcurl curl_easy_perform將帖子,空格和點替換為下划線

代碼類似於下面的示例。

另一方面,接收到的數據是錯誤的:

期望: <Text>data to send...</Text>
實際上: <Text>data_to_send___</Text>

CURL *curl = curl_easy_init();
if(curl) {
    const char *data = "<Text>data to send...</Text>";
    curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
}

有人知道原因嗎?

那是一個錯誤的結論,因此問題最終變得毫無用處。

libcurl將完全按照您為CURLOPT_POSTFIELDS提供的數據發送數據。 如果數據最終在您的某個表示層中看起來有所不同,則它已被某些其他層/軟件組件更改或顯示。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM