0

I have read everything I can find about REST style URIs and its noun and verbs, GET, POST, PUT, etc. What I did not see is where I put those methods to begin with. I can only find the back end PHP.

Is $_SERVER['REQUEST_METHOD'] looking at what I put here <form action="something.php" method="PUT">?

And from there I use the $_SERVER['REQUEST_METHOD'] to process it with switch or some other construct?

I think that's what this is saying, http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html


Seems you have to put it in a hidden value somewhere.

Community
  • 1
  • 1
johnny
  • 19,272
  • 52
  • 157
  • 259
  • 1
    REST is a style or mode of client-server interaction; it's not a prescription for programming. The [Wikipedia article on REST](http://en.wikipedia.org/wiki/Representational_state_transfer) might help shed some light on things, particularly the [section on architectural constraints](http://en.wikipedia.org/wiki/Representational_state_transfer#Architectural_constraints). – i alarmed alien Oct 01 '14 at 21:27
  • You can only make GET and POST requests with an html form, not PUT or DELETE. – Steve Oct 01 '14 at 21:28
  • You can use the other verbs with a library like cURL. GET and POST are the same HTTP verbs regardless of how they're requested. – Jay Blanchard Oct 01 '14 at 21:29
  • further reading: http://www.restapitutorial.com/lessons/httpmethods.html – Steve Oct 01 '14 at 21:31
  • @Steve I didn't not read every word, but I didn't see where the PUT is put to get to the server to begin with. – johnny Oct 01 '14 at 21:39
  • Sorry @johnny im not following you. Whatever client you are using (cURL, javascript ajax, any other http lib, **not an html form**) will have an option to set the request method – Steve Oct 01 '14 at 21:42

0 Answers0