11 years, 4 months ago.

status post in twitter using OAUTH

im having trouble posting twitter update in mbed, kindly see code below.

 OAuth4Tw oa4t("xxxxxxxxxxxxxxxxxx", // Consumer key
                  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // Consumer secret
                  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // Access token
                  "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); // Access token secret
    std::string uri = "https://api.twitter.com/1.1/statuses/update.json";
    uri += "?status=";
    uri += OAuth4Tw::url_escape("HelloWorld!");
    
    std::string postarg;
    std::string postres = oa4t.post(uri.c_str(), postarg);
    printf("uri: %s\n",uri.c_str());
    printf("postarg: %s\n", postarg);
    printf("postres: %s\n", postres.c_str());

and i get this response

req_url2:https://api.twitter.com/1.1/statuses/update.json
uri: https://api.twitter.com/1.1/statuses/update.json?status=HelloWorld%21
postarg:
postres:

my "POST" format is correct, but im the OAUTH is not pushing through..

can someone please help me how to make this thing work?

im using the "OAuth4Tw" library

none?

posted by kilo byte 02 Aug 2013
Be the first to answer this question.