Hello Adam, actually i am using basic authentication sending login and
password as a header request:

                            String url = "http://twitter.com/statuses/
friends_timeline.xml";
                            String credentials = "username:password";
                            credentials = encode(credentials); // this method 
encode
the login and password as base64
                            HttpConnection con = (HttpConnection)Connector.open
(url);
                            con.setRequestProperty("Authorization", "Basic " +
credentials);
                            con.setRequestMethod("GET");
                            con = (HttpConnection)Connector.open(url);
                            InputStream is1 = con.openInputStream();
                            showReply(con, is1); // This method displays in the
screen the reply from twitter that i have showed before.
                            is1.close();

This source code is j2me, i have implemented a similar code in java
and it works fine, no authentication problem but when i use the code
above, there is always the authentication problem message. Any idea?
thanks.

On 17 ago, 22:46, Adam Shannon <a...@ashannon.us> wrote:
> On Mon, Aug 17, 2009 at 9:42 PM, havis <bazoa...@gmail.com> wrote:
>
> > Hello, i am working on a project for mobile phones and Twitter API. I
> > made tests using java platform and everything works ok, when i use the
> > same credentials in j2me, there is always the following message as
> > response:
>
> > <?xml version="1.0" encoding="UTF-8"?>
> > <hash>
> >  <request>/statuses/friends_timeline.xml</request>
> >  <error>Could not authenticate you.</error>
> > </hash>
>
> > I am using basic authentication. Did you have this problem? Can
> > anybody help me please? thanks in advance.
>
> Are you using this basic format?
> http[s]://username:passw...@twitter.com/authenticate/
>
> --
> - Adam Shannon (http://ashannon.us)

Reply via email to