<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 19, 2017 at 9:43 AM, Esteban A. Maringolo <span dir="ltr"><<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2017-07-18 19:57 GMT-03:00 Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>>:<br>
<br>
> BTW... how can I allow something like this:<br>
><br>
> <path: '/companyreport/{ticker}/{<wbr>reportName}'><br>
><br>
> I then somehow I would like to parse the URL inside the method so that I<br>
> answer the correct response based on the URL ...<br>
<br>
<br>
</span>You should have a method like:<br>
<br>
getTicker: ticker report: reportName<br>
  <get><br>
<span class="">  <path: '/companyreport/{ticker}/{<wbr>reportName}'><br>
<br>
</span>There you'll have the ticker and reportName placeHolders mapped to the<br>
argument variable names. It is, the arguments of the method will hold<br>
whatever you put in those placeholders.<br>
<br>
But keep in mind this will only match a URI as a whole, if for some<br>
reason you add query parameters to the request, like<br>
'/companyreport/AAPL/<wbr>dailyChange?format=csv', you'll need another<br>
method, with another name and path pragma.<br>
<br>
That's why I implemented the "variableQuery" pragma [1], so you can<br>
have a fixed URI but variable queries mapped to a single smalltalk<br>
method. But it was removed [2] because there was a proper way [3] of<br>
implementing it I ignored/didn't understand at that time.<br>
<br>
This part of the framework is powerful, but certainly lacking<br>
examples, and without the behavior of [1] or [3] is too rigid for a<br>
flexible API.<br>
<br>
I could explain how it works, and use it as I do, but I can't tell I<br>
completely understand it as probably its creator does.<br>
<br></blockquote><div><br></div><div><br></div><div>Cool. Thank you very much Esteban. Very helpful and detailed response. </div><div>Really appreciated,</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
<br>
Esteban A. Maringolo<br>
<br>
[1] <a href="http://forum.world.st/New-Seaside-REST-Core-extension-td4872995.html" rel="noreferrer" target="_blank">http://forum.world.st/New-<wbr>Seaside-REST-Core-extension-<wbr>td4872995.html</a><br>
[2] <a href="http://forum.world.st/REST-quot-variable-queries-quot-td4941376.html#a4941377" rel="noreferrer" target="_blank">http://forum.world.st/REST-<wbr>quot-variable-queries-quot-<wbr>td4941376.html#a4941377</a><br>
[3] <a href="http://lists.squeakfoundation.org/pipermail/seaside/2014-December/031314.html" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/pipermail/seaside/2014-<wbr>December/031314.html</a><br>
______________________________<wbr>_________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.<wbr>squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" rel="noreferrer" target="_blank">http://lists.squeakfoundation.<wbr>org/cgi-bin/mailman/listinfo/<wbr>seaside</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br></div>
</div></div>