You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by Rob Owen <Ro...@sas.com> on 2003/02/10 20:15:42 UTC
[PATCH] Set the Content-Type header before setting requestBody
Using the new HttpClient, there are some methods (ACL, LABEL, LOCK, OPTIONS, PROPFIND, PROPPATCH, REPORT, SEARCH) where the request body is not encoded correctly. XMLResponseMethodBase.getRequestContentLength() calls generateRequestBody() to create the request body string and then calls setRequestBody with this string. setRequestBody(String) does not take a charset into account and transforms this string into an array of bytes using the platform's default charset.
HttpClient (EntityEnclosingMethod) approached this by checking the Content-Type header and using the corresponding charset. This means that the charset (Content-Type header) must be set before the getRequestContentLength method is called and hence the changes to the addRequestHeaders method in each of the methods mentioned.
------
Rob Owen
SAS Institute Inc.
email: Rob.Owen@sas.com
Re: [PATCH] Set the Content-Type header before setting requestBody
Posted by Jeffrey Dever <js...@sympatico.ca>.
Hey Rob,
I didn't see any patch files on either of these 3 posts.
-jsd
Rob Owen wrote:
>Using the new HttpClient, there are some methods (ACL, LABEL, LOCK, OPTIONS, PROPFIND, PROPPATCH, REPORT, SEARCH) where the request body is not encoded correctly. XMLResponseMethodBase.getRequestContentLength() calls generateRequestBody() to create the request body string and then calls setRequestBody with this string. setRequestBody(String) does not take a charset into account and transforms this string into an array of bytes using the platform's default charset.
>
>HttpClient (EntityEnclosingMethod) approached this by checking the Content-Type header and using the corresponding charset. This means that the charset (Content-Type header) must be set before the getRequestContentLength method is called and hence the changes to the addRequestHeaders method in each of the methods mentioned.
>
>------
>Rob Owen
>SAS Institute Inc.
>email: Rob.Owen@sas.com
>
>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: slide-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org