¿How can I do this?
Some sites need authentication through an username and password. In
Internet Explorer you can do it with this URL:
http://login:password@server
But it doesn't work with J2ME.
MIDP documentation tells you can do it with HttpConnection class
through the setRequestPrope rty method, but it's needed to do it before
connect. The one way I know to use an HttpConnection is through these
sentences:
HttpConnection c = null;
c = (HttpConnection )Connector.open (url);
So connection is done inmediately and setRequestPrope rty cannot be
used.
Some tutorials tell it can be done this way:
HttpConnection c = null;
c = (HttpConnection )Connector.open (url);
c.setRequestPro perty("...");
They tell it works because the connection is opened when doing
c.openInputStre am(), but it doesn't work, an error occurs telling the
connection is open.
Anyone know the solution?
Best regards
David Aldavero