我正在尝试使用以下代码向Twitter发布推文,但不断收到错误"无法验证您","代码":32":
curl_global_init(CURL_GLOBAL_ALL);
CURL *curl = curl_easy_init();
char *signedurl = malloc(sizeof(char) * 1024); /* Not how it will be, but works in this example. */
char *url = "https://api.twitter.com/1.1/statuses/update.json";
signedurl = oauth_sign_url2(url, NULL, OA_HMAC, "POST", consumer_key, consumer_secret, user_token, user_secret);
char *status = "status=test";
curl_easy_setopt(curl, CURLOPT_URL, signedurl); /* URL we're connecting to, after being signed by oauthlib */
curl_easy_setopt(curl, CURLOPT_USERAGENT, "dummy-string"); /* Not the actual string, just a dummy for this example */
curl_easy_setopt(curl, CURLOPT_POST, 1);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, status);
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); …Run Code Online (Sandbox Code Playgroud)