Shindig (both versions) fully support :
http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol

In the case of the comment you copied, it's the POST/PUT action on /people
... which isn't part of the OpenSocial spec, and the comment indicates that
some day it *could* possibly be added to the spec (like for adding friends
or something), in which case that bit of code will be replaced by the proper
action.

The json-rpc and rest implementations both use the exact same
implementations btw, just get there through a different code path (see
ApiServlet for the base class, JsonRpcServlet for the json-rpc
implementation and DataServiceServlet for the REST one). For instance a GET
on /social/rest/people is the same as a json-rpc request with
{'method':'people.get'}.

So with that hopefully cleared up, I have to admit that I haven't used the
REST gadgets JavaScript code for a long time .. so I have no idea what shape
that is in.. but that's all that the switch in the shindig/js/container.js
file does, switch over the js code that powers the social data calls in
gadgets; If you want to use the REST endpoint in any other situation,
there's no need to change that config file at all, you can just call the
url's directly.



On Mon, Dec 29, 2008 at 11:51 AM, Jerôme Gangneux <
[email protected]> wrote:

> I remember that REST was the default protocol for PHP at the beginning, and
> shindig switch to RPC to uniforms Java and PHP
> Ok that's cool but does it mean that REST for PHP (and I'm not talking
> about
> REST in opensocial here) is abandoned?
> I see this in the code
>
> {{{
>        // in our current implementation this will throw a
> SocialSPIException since we don't support
>        // adding people/friendships in our API yet, but this might be added
> some day
> }}}
> in /php/src/social/service/RestRequestItem.php line 62
>
> and if I switch RPC to REST in container.js (config) it doesn't work
> anymore
> getting 500 errors
> {{{
> <h1>500 Internal Server Error - Internal Server Error</h1>
> Invalid or unknown service endpoint: jsonBatch?st=RTN5RVVybW(...)
> }}}
>
> Yes I know, RPC is better etc, but I really need REST for some proof of
> concept dev
> what's the plan ?
>
> Jerome G
>

Reply via email to