The Symfony2 cookbook already contains a SOAP Webservice entry [1],
and I think we should try to make one for REST.
Their is plenty of way to do it, with the Bundles, or manually,
but a cookbook entry would have to keep it short and easy.
IMO we should explain the basics of doing it without the RestBundle:
- constrain the HTTP method;
- make your API stateless;
- using the Serializer from JMS;
- using a content negotiation library;
- accept PUT and POST to edit Doctrine2 entities;
- maybe talk a bit about authentication...
A second entry could talk about building it with all the power from RestBundle, Hateoas, ApiDoc...
By the way, resource editing is always tricky because we do not know what to do:
- accept a real XML/Json payload and use Serializer->deserialize to get an entity back?
- accept "application/x-www-form-urlencoded" and use a FormType to apply changes?
Applying changes on an entity from a real payload is a pain or is it just me? :)
Cheer,
Damien