400 bad request when using greader api on android
<p>I'm trying to use the Google Reader API for my android app and i'm having trouble marking items as read. I'm getting 400 bad request.</p>

<p>Other things do work:
Logging in, Getting a token, getting subscriptions.items etc.</p>

<p>I'm using apache HttpClient 4.
I have almost the same thing working as a standard java application only that one uses HttpClient 3 so i had to change it i little bit for android. But since that is working i know a have all the parameters and headers correct. </p>

<p>One thing that is different from the working java version is the way the parameters are put in the request.
In the android version it's like this:</p>

<pre><code>public String post(String pUrl, List&lt;Parameter&gt; pParams, boolean pUseCookies) throws GoogleReaderException {

    ArrayList&lt;NameValuePair&gt; postParameters = (ArrayList&lt;NameValuePair&gt;) (toNameValuePairArray(pParams));

    HttpPost postRequest = new HttpPost(pUrl);

    try {
        postRequest.setEntity(new UrlEncodedFormEntity(postParameters, HTTP.UTF_8));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }

    return execute(postRequest, pUseCookies);
}
</code></pre>

<p>And the java version:</p>

<pre><code>method.setQueryString(toNameValuePairArray(parameters));
</code></pre>

<p>I compared the parameters in both versions and they are the same (apart from some encoded characters).</p>

<p>android (before postRequest.setEntity ...)</p>

<pre><code>s=feed%2Fhttp%3A%2F%2Fwww.androidworld.nl%2Ffeed%2F,i=tag%3Agoogle.com%2C2005%3Areader%2Fitem%2F6ef6e1f6dc7771f9,T=//zJFXmCBQIkK8ezEyHOOyfg,async=true,pos=0,a=user/**************/state/com.google/read
</code></pre>

<p>java</p>

<pre><code>s=feed%2Fhttp%3A%2F%2Fwww.androidworld.nl%2Ffeed%2F&amp;i=tag%3Agoogle.com%2C2005%3Areader%2Fitem%2F3780679ca7889e59&amp;T=%2F%2F9UbDv2m3tUidkFNy5f9vxA&amp;async=true&amp;pos=0&amp;a=user%2F**************%2Fstate%2Fcom.google%2Fread
</code></pre>

<p>I have no idea where to look now.</p>

<p>Let me know if i need to post more detailed info and if so what.</p>

<p>Thanks!</p>
