Re: [Pharo-users] Teapot and Regex
Am 04.08.15 um 13:34 schrieb Marcus Kemper via Pharo-users: Hi Marcus, I am slowly getting what Teapot does... So you setup an Association with a String that matches the URL of an incoming request as key and its handler block as value. So you should be able to use "req at: #r" also when using the Regex as matching criteria. Once you confirm this, the ordering is neither relevant nor a problem for you and you can go forward. Just forget about indexed access to request data for the future. Please let us know if access by symbols works for you. Joachim -- ----------------------------------------------------------------------- Objektfabrik Joachim Tuchel mailto:jtuchel@objektfabrik.de Fliederweg 1 http://www.objektfabrik.de D-71640 Ludwigsburg http://joachimtuchel.wordpress.com Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
Hi Joachim, thanks for your attention to this issue. I tried to change it to #a, #r or #kg, but this didn't work. It works with the following by leaving the '\?' out: GET:'\/bac\/a=(\d*)&r=(\d*.\d*)&kg=(\d*)' asRegex -> [:req | BloodAlcoholCalculator a:(req at:1) r:(req at:2) kg:(req at:3) ]; But it works only by manually submitting it from the address input field of the browser. So I guess there is a problem with handling the '\?'. I will investigate further! :-) Best Marcus -- View this message in context: http://forum.world.st/Teapot-and-Regex-tp4840893p4840921.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (2)
-
jtuchel@objektfabrik.de -
mtk