I am wanting to build an API first RESTful application in PHP. I have never attempted to do this so I have some questions about how to handle PUT
and DELETE
So for an example if I have a API endpoint that updates a User profile, should I make it accept BOTH a POST
and PUT
Request?
If I was building a Client for my API as a Desktop app or iOS app, etc it would be easy to send a PUT
request to my API but I plan to have a Web based app for my API as well.
So on my web based app, I would have an HTML Form to Update a User profile, this would then be sent as a POST
as HTML Forms do not allow PUT
requests.
Could someone with more experience with this explain the best way to handle my example scenario?
Would the proper way be to send my Form as a POST
to my PHP script, then my PHP script would make a proper PUT
request to my PHP API with cURL?