Hi,
I'm working on an application that should connect to twitxr API.
As seen on the documentation :
"
The requests are done like this:
http://user:md5(pass)@twitxr.com/api/rest/method?param1=value&param2=value
"

I have no truble working with methods that requires a GET HTTP and
authentication, so I'm sure my authetication works fine.

But I can't make postUpdate method (the only one that uses POST HTTP)
to work,
the API keeps returning me the xml that meens something went wrong.

I've test the post vars I'm sending by using a php test page and
everything sounds all right.

Here's my code :

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://"; + user_login + ":" +
md5(user_password) + "@twitxr.com/api/rest/postUpdate");

try
{
        // add vars to the request
        List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>();
        nameValuePairs.add(new BasicNameValuePair("place", place));
        nameValuePairs.add(new BasicNameValuePair("text", text));
        httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
        //
        HttpResponse response = httpclient.execute(httppost);
        ...

}

catch (ClientProtocolException e)
{
        // TODO Auto-generated catch block

}

catch (IOException e)
{
    // TODO Auto-generated catch block

}


What could be the problem here ?
Is there any trick that I should be aware concerning posting values ?
special encoding for POST vars ?
Is List<NameValuePair> nameValuePairs = new
ArrayList<NameValuePair>(); is the good way to send POST vars ?


Thanks a lot for your help.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to