hello,

I am using NameValuePairs to transfer some strings
to a server with the following content type:

 application/x-www-form-urlencoded

My content change from  "!"  to  "%12"

Can I also use encoder/decoder for my strings or
is  there a better way to transfer data correctly?

Which kind of charset should I use?

bastian



>  import org.apache.commons.codec.binary.Base64;
> 
> byte[] bytes = "I love my byte array".getBytes();
> byte[] base64Bytes = Base64.encodeBase64( bytes );
> 
> System.out.println( new String( base64Bytes ) );
> Outputs:
> 
> SSBsb3ZlIG15IGJ5dGUgYXJyYXk=
> 
> Good luck!  Like Roland said, "commons-codec.jar" is already on your
> classpath.  The Base64 class is available for you to use.
> 
> yours,
> 
> Julius
> 
> 
> On 12/6/06, Roland Weber <[EMAIL PROTECTED]> wrote:
> >
> > Hello Marcelo,
> >
> > it is not the same encoding used in URLs.
> > HttpClient does not have a Base64 encoder,
> > but it uses commons-codec for this purpose.
> >
> > hope that helps,
> >   Roland
> >
> > "Marcelo Chryssovergis" <[EMAIL PROTECTED]> wrote on 06.12.2006
> > 15:16:46:
> >
> > > Hello,
> > >
> > > I´m trying to login to a asp.net site.
> > >
> > > I´m using the postmethod to send the data, but one of the fields of
> > > the framework .Net (VIEWSTATE) has to be converted in a
> > > Base64String. I believe that´s the same encoding used in URLs.
> > >
> > > Is there any function in httpclient to encode the string to base64?
> > >
> > > Thanks,
> > > Marcelo
> >
> >
> >
> 
> 
> -- 
> yours,
> 
> Julius Davies
> 416-652-0183
> http://juliusdavies.ca/

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to