Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I know this is an old question but it seems it takes a bit of digging around to finally get a proper answer. This seems to be one of the top links in google too. Pages at dev.twitter.com lead to almost nowhere also. So here it goes. Look <a href="https://github.com/cyrus7580/twitter_api_examples" rel="nofollow">here</a> for a code that properly handles it. It uses <code>HttpCore</code>, but it can be achieved with standard libraries.</p> <p>Making the story short.</p> <ol> <li>URLEncoder library in 1.6 (most likely then in Android too) doesn't conform to the RFC standard Twitter API requires. The code here seems to be countering the problem partially. Take a look at the source I linked to find the method handling it appropriately.</li> <li>While creating the base string parameter you are encoding each key value pair. It conforms to the guide at the twitter page. It is easier to append the encoded url and the whole created parameter string (key/value pairs)</li> <li>While creating the signature you are creating it against a keyspec object with the CONSUMER_KEY appended with "&amp;" sign in request token method of the Twitter API.</li> <li><p>As far as for this code. For request token it doesn't seem to be important at all.</p> <pre><code>connection.setRequestProperty("Accept-Charset", charset); connection.setRequestProperty("Content-Type", "application/x-www-formurlencoded;charset="+ charset); connection.setRequestProperty("User-Agent", "XXXX"); </code></pre> <p>This one though, does <code>connection.setRequestMethod(method);</code></p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload