Welcome Guest, Not a member yet? Register   Sign In
RESTful resource handling and delete: controller method not found
#4

It depends on how you are requesting it. Anything visited in a browser is a GET request. HTML forms are usually POST (method="post"). The other HTTP verbs (PUT, PATCH, DELETE) have to be specified in whatever library or application you are using to call it.

For example, if you are using Axios (common in VueJS), you can do something like:

Code:
axios.get(url, config)
axios.delete(url, config)
axios.post(url, data, config)
axios.put(url, data, config)
axios.patch(url, data, config)

The advantage is you can use the same path (administration/user/1) for multiple operations depending on the HTTP verb.

Per the resource you defined, there isn't suppose to be any administration/user/delete/1.
Reply


Messages In This Thread
RE: RESTful resource handling and delete: controller method not found - by xenomorph1030 - 01-19-2022, 08:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB