Hello Marcelo, > Actually I don´t need (and I can´t) encode the whole string, only chars > considered invalid to base64. > What I am doing is the same as you: I´m replacing some chars explicitly > to the corresponding one in base64. > > Example: > ":" to %3A > "/" to %2F > "+" to %2B
This is NOT base64! This is www-url-encoded. > The problem here, is that I missing some char and getting an error from > server: "Invalid character in a Base-64 string." That may be because you're not generating a base64 string at all. Please follow the instructions in the Client HTTP Programming Primer to analyze _what_ you should actually be sending. You may have to install a network sniffer to be sure about what's sent by a browser. If something needs to be base64-encoded, it is either generated by the server or you'll find JavaScript that performs base64 encoding. http://wiki.apache.org/jakarta-httpclient/ForAbsoluteBeginners If you need www-url-encoding, just add the name/value pairs as parameters to the PostMethod, the method should take care of the encoding. http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/PostMethod.html#addParameter(org.apache.commons.httpclient.NameValuePair) hope that helps, Roland --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
