Hi, I have a desktop application using libcurl that has "oob" as the
call back
I am making an Authorization: header and appending all the required
items, but when i send my request, i get nothing back - curl just
waits for a response from the server for ever, here's a snippet, this
is to get a request token btw:
signatureBaseString = getSignatureBaseString();
key = consumerSecret + "&";
signature = format::encrypt(signatureBaseString, key);
basicHeader.push_back("oauth_nonce=\"" + format::encode( noonce,
curl ) + "\", ");
basicHeader.push_back("oauth_callback=\"" + format::encode( callBack,
curl ) + "\", ");
basicHeader.push_back("oauth_signature_method=\"" +
format::encode( signatureMethod, curl ) + "\", ");
basicHeader.push_back("oauth_timestamp=\"" +
format::encode( timeStamp, curl ) + "\", ");
basicHeader.push_back("oauth_consumer_key=\"" +
format::encode( consumerKey, curl ) +"\", ");
basicHeader.push_back("oauth_signature=\"" +
format::encode( signature, curl ) + "\", ");
basicHeader.push_back("oauth_version=\"" +
format::encode( oauthVersion, curl ) + "\"");
postData = format::vectorToString(basicHeader);
postData = "Authorization: OAuth " + postData;
headers = curl_slist_append(headers, postData.c_str() );
std::cout << "postdata: " << postData << std::endl;
post(headers, requestTokenUrl);
postData would look like this (consumer key censored):
Authorization: OAuth oauth_nonce="vmhufwrwnjdkaupa",
oauth_callback="oob", oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1274568595",
oauth_consumer_key="XxXXXxxXXxxXXXxxXXx",
oauth_signature="v8EdkEk3V3XijCwdsoTIk5x9Z3w%3D", oauth_version="1.0"
the post function looks like this
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_CAINFO, "./
VeriSignClass3ExtendedValidationSSLCA");
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &curlapiPageBuffer);
curl_easy_setopt(curl, CURLOPT_POST, 1);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
curl_easy_setopt(curl, CURLOPT_COOKIE, curlCookie.c_str() );
curl_easy_setopt(curl, CURLOPT_URL, url.c_str() );
curlResult = curl_easy_perform(curl);
std::cout << curlapiPageBuffer << std::endl;
is anyone seeing any mistakes here?
thanks