have handle on GET/POST/DELETE/PUT method
See original GitHub issueFor a specific project i would like not use CRUD but keep handing on differents methods.
# In src/AppBundle/Entity/Book.php
<?php
@ORM\Entity
@ApiResource(
itemOperations={
"get"={"method"="GET"},
"put"={"method"="PUT"},
"delete"={"method"="DELETE"},
"special"={"route_name"="book_special"},
"specialget"={"route_name"="book_special"},
}
)
# In src/AppBundle/Action/BookSpecial.php
<?php
@Route(
name="book_special",
path="/books/{id}/special",
defaults={"_api_resource_class"=Book::class, "_api_item_operation_name"="special"}
)
@Method({"GET", "PUT"})
I must create a file for each method (GET,PUT,DELETE,…) and change route_name or can use controller and define each method?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
HTTP REQUEST Methods-GET, POST, PUT, PATCH, DELETE.
In this article, we are going to learn the most common HTTP methods(POST, GET, PUT, PATCH, DELETE). If you are a beginner then...
Read more >Using HTTP Methods for RESTful Services - REST API Tutorial
HTTP methods tutorial on how to use them for RESTful API or Web Service. ... methods, as they are properly called) are POST,...
Read more >Handle HTTP POST, PUT, GET and HTTP Delete Requests
Click the below link to download the Java Source code and PPT: ...
Read more >HTTP request methods - MDN Web Docs
Chrome Edge
CONNECT Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
DELETE Full support. ChromeYes. Toggle history Full support. Edge12. Toggle history
GET Full...
Read more >HTTP Request Methods – Get vs Put vs Post Explained with ...
HTTP Protocol; Client-server architecture; APIs. By the end of this article you'll have a good understanding of the functions of each request ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just implement a DataProvider if you want to do custom queries. There are really a few use cases where a Controller is valid with ApiPlatform. Most of the use cases can be dealt with by implementing one of those:
It seems that all the linked PRs have been merged. This can be closed.