Senin, 27 Februari 2012

HTTP Method PATCH

Kemarin mendapat artikel pada blog Ruby on Rails bahwa HTTP Method PATCH merupakan HTTP Method untuk Update pada Ruby on Rails menggantikan HTTP Method PUT. Hal ini akan berlaku pada Ruby on Rails versi 4.

PUT in addition is an idempotent method. You should be able to replay a request as many times as you want and get the same resource, something that sometimes is violated by conventional idioms for creating children resources using nested attributes while updating a parent resource.
There's nothing theoretical preventing PUT from doing partial updates, but when HTTP was being standarized the replacement semantics were already deployed.
Because of that, the PATCH method was defined in 1995 and standarized later. PATCH is a method that is not safe, nor idempotent, and allows full and partial updates and side-effects on other resources.
Bagaimana dengan web server? Saat HTTP Client seperti Curl mengirim PATCH, dapat mengerti request PATCH. Dengan begini, Ruby on Rails semakin RESTful.

Artikel Terkait

Tidak ada komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...