-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Add REST API cookbook entry #4022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ Web Services | |
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
rest_api | ||
php_soap_extension |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. index:: | ||
single: Web Services; REST API | ||
|
||
How to Create a REST Web Service in a Symfony2 Controller | ||
========================================================= | ||
|
||
A REST controller must be able to list, retrieve, create and update a resource. | ||
This resource can be anything from a Doctrine entity to a domain object or a network device. | ||
|
||
.. note:: | ||
|
||
There is plenty of way to implement to REST API with Symfony2, we will show you how to implement | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. way -> ways |
||
a simple API with core components but you can also look at `FOSRestBundle`_ if you are looking | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i like this approach that is not tied to FOSRestBundle but that goes in detail on the inner components |
||
at building a large API with hypermedia, versionning, automatic routing and more. | ||
|
||
Setting up the routing | ||
---------------------- | ||
|
||
Dealing with response code | ||
-------------------------- | ||
|
||
Exposing resources in different formats | ||
--------------------------------------- | ||
|
||
Updating Doctrine entities | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not include any reference to Doctrine. |
||
-------------------------- | ||
|
||
|
||
.. _`FOSRestBundle`: https://github.com/FriendsOfSymfony/FOSRestBundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a rest controller must be able?this is confusing, it's up to the controller / router what kind of verbs are supportet.