Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread Marcus Kemper via Pharo-users
--- Begin Message --- Good morning, Thanks for the hint. I will check the settings. Kind regards Marcus jtuc...@objektfabrik.de schrieb am Mi., 5. Aug. 2015 05:58: > Oh, and Marcus: > > Please check your mail program: I only see your mail text as an > attachment, and on some mail readers (e.g

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread jtuc...@objektfabrik.de
Oh, and Marcus: Please check your mail program: I only see your mail text as an attachment, and on some mail readers (e.g. iPhone) it is not even properly displayed. It is hard to cite your text and answer in the way we're used to do on mailing lists... Joachim -- -

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread jtuc...@objektfabrik.de
Am 05.08.15 um 05:44 schrieb mtk via Pharo-users: Hi Marcus, good to hear you could make it work. Thankfully, Attila gave us the final explanation for the regex mystery ;-) So I guess it is best to stick with "normal" strings for the most part for several reasons: * performance: (matching str

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread mtk via Pharo-users
--- Begin Message --- Hi Attila, many thanks for your explanation - now it works by simply putting: GET:'/bac/' -> [:req | BloodAlcoholCalculator a:(req at:#a) r:(req at:#r) kg:(req at:#kg) ]; So you and Joachim were both right... :-) That makes it even easier to work with teapot. Kind regar

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread Attila Magyar
Hi Marcus, It seems you're trying to define a matcher on the query parameters. It's not going to work. An url consist of path a the query part. These are separeted by a question mark. http://localhost:1701/foo/bar?q1=xx&q2=yy In this example /foo/bar is the path, and q1 and q2 are the query p

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread mtk via Pharo-users
--- Begin Message --- 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:

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread jtuc...@objektfabrik.de
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

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread Marcus Kemper via Pharo-users
--- Begin Message --- Hi Joachim, my first steps in teapot used the named parameters (and manually sending the URL), but as soon as I used the HTML form, I had to switch to regex (I thought). Maybe this was wrong, but your hint concerning the 'req' will certainly yield new insights. I will try to

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread jtuc...@objektfabrik.de
Marcus, Hi Joachim, thanks for your feedback. Concerning the order of the values I rely solely on the teapot error message. The way I understand your code snippet, you access the url parameters by using "at: 1". I have never used Teapot, but would be surprised if it encourages this. In HTT

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread mtk via Pharo-users
--- Begin Message --- Hi Joachim, thanks for your feedback. Concerning the order of the values I rely solely on the teapot error message. Besides I have no idea how I could make this GET request independant from the order the HTML form generated. Maybe with Javascript? But I assume this simple sce

Re: [Pharo-users] Teapot and Regex

2015-08-04 Thread jtuc...@objektfabrik.de
Marcus, I have no answers to your questions, but it seems like you expect the URL parameters in a specified order. I am nat sure this is a good idea at all. So independent on why the order of the parameters is changed and by whom: you shouldn't rely on it. Sure, this doesn't really help to un