[Seaside] SeaSide REST
Jupiter Jones
jupiter.jones at mail.com
Fri Oct 31 01:53:34 UTC 2014
> 1) Why do I see this error in SeaSide, and how do I fix it? I have the latest SeaSide running on latest Pharo 3 with Seaside-REST
>
> http://localhost:8080/ <http://localhost:8080/>
>
> Error: you are forbidden to access “/"
There may be no default handler, or your REST service is the default and is not matching “/“
Try:
http://localhost:8080/browse <http://localhost:8080/browse>
or
http://localhost:8080/config <http://localhost:8080/config>
which will allow you to set the default.
> 2) I have a Seaside REST object that is not responding to the URL request below.
>
> http://localhost:8080/weight/kg?lb=10 <http://localhost:8080/weight/kg?lb=10>
>
> I have the following class/instance configuration. Am I missing something else?
>
> WARestfulHandler subclass: #WeightRestHandler
> its class initialize method contains:
> WAAdmin register: self at: self 'weight'.
>
> And it has an instance method "weight" with following annotation:
>
> <get>
> <produces: 'text/json'>
> <path: '/{toUnit}?{fromUnit}={aNumber}’>
you may need a method selector that defines the keywords toUnit, fromUnit and aNumber.
ie.
weight: toUnit from: fromUnit value: aNumber
<get>
<produces: ‘text/json’>
<path: '/{toUnit}?{fromUnit}={aNumber}’>
I’ve just started working with REST so let me know if it doesn’t work :)
Cheers,
Jupiter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20141031/28169e6c/attachment.htm
More information about the seaside
mailing list