Return-Path: Delivered-To: apmail-jakarta-httpclient-user-archive@www.apache.org Received: (qmail 9077 invoked from network); 6 Dec 2006 16:46:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2006 16:46:28 -0000 Received: (qmail 21719 invoked by uid 500); 6 Dec 2006 16:46:36 -0000 Delivered-To: apmail-jakarta-httpclient-user-archive@jakarta.apache.org Received: (qmail 21525 invoked by uid 500); 6 Dec 2006 16:46:35 -0000 Mailing-List: contact httpclient-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: "HttpClient User Discussion" Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-user@jakarta.apache.org Received: (qmail 21514 invoked by uid 99); 6 Dec 2006 16:46:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Dec 2006 08:46:35 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.227.126.183] (HELO moutng.kundenserver.de) (212.227.126.183) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Dec 2006 08:46:23 -0800 Received: from [85.180.4.201] (helo=[85.180.4.201]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis), id 0MKwpI-1GrzuD2gQe-0000hV; Wed, 06 Dec 2006 17:46:01 +0100 Message-ID: <4576F488.8070807@dubioso.net> Date: Wed, 06 Dec 2006 17:49:12 +0100 From: Roland Weber User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061110 SeaMonkey/1.0.6 MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: PostMethod - parameter in BASE64String References: <000a01c71941$2ac10550$c900a8c0@marcelo> <598ad5b50612060605l41f89869jd1832af801cf5f4c@mail.gmail.com> <20061206144422.155010@gmx.net> <001801c7195b$5c3d5470$c900a8c0@marcelo> In-Reply-To: <001801c7195b$5c3d5470$c900a8c0@marcelo> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: kundenserver.de abuse@kundenserver.de login:4601b1d39ab4ddfc21c613822e406392 X-Virus-Checked: Checked by ClamAV on apache.org 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: httpclient-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-user-help@jakarta.apache.org