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 params.

When you define a route in Teapot you specify the path part (either with
wildcards or with regexp). Teapot will select the matching route when a
request comes in based on the path part, and it will parse the query part
(in fact Zn does this), and make the query parameters accessible in the
request object.

For example

GET: '/foo/bar' -> [:req | req at: #q1]

This matches to an url whose path part is /foo/bar, even if there is no
query part, or if it has many query parameters.

In your example, you've defined the query part in the matcher, but since it
is not part of the incoming url, you've got 404.

But if you share what you're trying to accomplish I may be able to help.

Attila





--
View this message in context: 
http://forum.world.st/Teapot-and-Regex-tp4840893p4840936.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to