What is the purpose of using "PUT" method in a form with PHP? -
What is the purpose of using "PUT" method in a form with PHP? -
i wanted know, why form method put
used?
what exact purpose ?
what real time scenario in can utilize ?
is more safe or post ?
if take @ page 55 of rfc 2616 (“hypertext transfer protocol – http/1.1”), section 9.6 (“put”)
, you’ll see set for:
the set method requests enclosed entity stored under supplied request-uri. there’s handy paragraph explain difference between post , put:
the fundamental difference between post , set requests reflected in different meaning of request-uri. uri in post request identifies resource handle enclosed entity. resource might data-accepting process, gateway other protocol, or separate entity accepts annotations. in contrast, uri in set request identifies entity enclosed request – user agent knows uri intended , server must not effort apply request other resource.
when should utilize set , when should utilize post?use set when can update resource through specific resource. instance, if know article resides @ http://example.org/article/1234, can set new resource representation of article straight through set on url.
if not know actual resource location, instance, when add together new article, not have thought store it, can post url, , allow server decide actual url.
use http set method when:
the client includes aspect of resource including unique identifier uniquely identify resource. example: creating new employee. the client provides info resource able modify resource.this implies server side not update aspect of resource (such update date).in both cases, these operations can performed multiple times same results. resource not changed requesting operation more once. hence, true idempotent operation.
references
http://restcookbook.com/http%20methods/put-vs-post/ http://www.filecatalyst.com/rest-http-post-vs-http-put http://php.net/manual/en/features.file-upload.put-method.php php forms post get put
Comments
Post a Comment