libcurlのリクエストボディに正常にパラメータを追加できた(#47)
This commit is contained in:
@@ -67,14 +67,13 @@ void Update::process(std::weak_ptr<CocoaTweet::OAuth::OAuth1> _oauth,
|
|||||||
CURLcode res;
|
CURLcode res;
|
||||||
std::string rcv;
|
std::string rcv;
|
||||||
curl = curl_easy_init();
|
curl = curl_easy_init();
|
||||||
url_ = url_ + "?status=" + status_;
|
url_ = url_;// + "?status=" + status_;
|
||||||
std::cout << "URL : " << url_ << std::endl;
|
std::cout << "URL : " << url_ << std::endl;
|
||||||
if (curl) {
|
if (curl) {
|
||||||
curl_easy_setopt(curl, CURLOPT_URL, url_.c_str());
|
curl_easy_setopt(curl, CURLOPT_URL, url_.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_POST, 1);
|
curl_easy_setopt(curl, CURLOPT_POST, 1);
|
||||||
// curl_easy_setopt(curl, CURLOPT_POSTFIELDS, requestBody);
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, requestBody.c_str());
|
||||||
// curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, requestBody.length());
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, requestBody.length());
|
||||||
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0);
|
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlCallback_);
|
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlCallback_);
|
||||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (std::string*)&rcv);
|
curl_easy_setopt(curl, CURLOPT_WRITEDATA, (std::string*)&rcv);
|
||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
|
|||||||
Reference in New Issue
Block a user