I had a problem when implementing RESTful Web Service, does all RESTful routes always contains GET, POST, PUT, DELETE? For example, i have Candidate and User model, should i serve those HTTP methods in my route?
Thanks, sorry for my bad English.
I had a problem when implementing RESTful Web Service, does all RESTful routes always contains GET, POST, PUT, DELETE? For example, i have Candidate and User model, should i serve those HTTP methods in my route?
Thanks, sorry for my bad English.
does all RESTful routes always contains GET, POST, PUT, DELETE?
No. Only provide what's useful to you.
For example, i have Candidate and User model, should i serve those HTTP methods in my route?
Do you need those routes in your application? If so, yes. If not, no.
/candidates, and the User model might use /users. An admin or a regular user would use both of these routes, but they could each have different permissions. For example, perhaps regular users could only GET. The API server could inspect their access token or cookie (or whatever you're using for authentication) and decide whether or not to authorize the user to perform the action they're requesting.