[Helma-user] Losing req.data when setting charset in Content-Type-Header
Thomas Hammerl
thomas.hammerl at knallgrau.at
Thu Mar 15 15:39:03 CET 2007
Hi!
I'm implementing/testing trackbacks
(http://www.sixapart.com/pronet/docs/trackback_spec) for a blogging
platform (www.blogr.com). When sending a trackback with Apache's
HttpClient declaring a charset in the Content-Type HTTP-Header of the
request the parameters in req.data are lost although they are sent in
the body. If I don't set a charset the parameters are sent encoded in
ISO-8859-1 and available in req.data.
Sending the Request using Apache's HttpClient:
<code>
var method = new
Packages.org.apache.commons.httpclient.methods.PostMethod(url);
// method.addRequestHeader("Content-Type","application/x-www-form-urlencoded;
charset=UTF-8"); doesn't work
// method.addRequestHeader("Content-Type","application/x-www-form-urlencoded");
works
method.addParameter("url", this.href());
method.addParameter("blog_name", jlsBlog);
method.addParameter("title", jlsTitle);
method.addParameter("excerpt", jlsText);
</code>
HTTP-Request (logged with req.getServletRequest()-object):
<request>
POST /helma/twoday_media_head/admin/stories/77/modTrackback HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: localhost:8080
Cookie: $Version=0; HopSession=127.0.0.1gcdtrpgbwti1; $Path=/
Content-Length: 490
url=http%3A%2F%2Flocalhost%3A8080%2Fhelma%2Ftwoday_media_head%2Fadmin%2Fstories%2F150%2F&blog_name=localhost%3A
8080%2Fhelma%2Ftwoday_media_head%2Fadmin&title=Webdeveloper%2Fin+gesucht+%28mal+wieder%29&excerpt=Knallgrau+sucht+wieder+mal+weitere+Verst%C
3%A4rkung%21An+dieser+Stelle+verweise+ich+schlicht+auf+die+aktuelle+Stellenausschreibung+auf+knallgrau.at%3A-%3E+http%3A%2F%2Fwww.knallgrau.
at%2Fcompany%2Fjobs%2Fprogrammierung210207%2F+Und+mache+noch+auf+den+darin+enthaltenen+Hinweis+a...
</request>
E.g. Wordpress processes this trackback-ping without any problems.
Is it possible that this is a Helma-bug? I'm using Helma 1.6 (latest snapshot).
Greetings,
Thomas
More information about the Helma-user
mailing list