Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RESTful web services and HTTP verbs

What is the minimum set of HTTP verbs that a server should allow for a web service to be classed as RESTful?

What if my hoster doesn't permit PUT and DELETE?

Is this actually important, can I live happily ever after with just GET and POST ?


Update: Thanks for the answers folks, Roger's answer was probably best because of the link to the Bill Venners and Elliotte Rusty Harold interview. I now get it.


like image 207
Kev Avatar asked Aug 23 '08 04:08

Kev


People also ask

What are the mostly used HTTP verbs with RESTful services?

The primary or most-commonly-used HTTP verbs (or methods, as they are properly called) are POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete (or CRUD) operations, respectively. There are a number of other verbs, too, but are utilized less frequently.

Can we use verbs in REST API?

Simply because RESTful APIs are based on resources and use the HTTP verbs (GET, POST, PUT, DELETE, PATCH), does not mean they should only support CRUD (Create, Read, Update, Delete) operations. RESTful APIs can also be used for performing other actions on resources.

What is HTTP method in RESTful web services?

HTTP methodsGET − Provides a read only access to a resource. POST − Used to create a new resource. DELETE − Used to remove a resource. PUT − Used to update a existing resource or create a new resource.

What are 4 main HTTP verbs methods )?

The primary or most commonly-used HTTP methods are POST, GET, PUT, PATCH, and DELETE.


1 Answers

Yes, you can live without PUT and DELETE.

This article tells you why: http://www.artima.com/lejava/articles/why_put_and_delete.html

While to true RESTafrians this may be heresy, in the real world you do what you can, with what you have. Be as rational as you can and as consistent with your own convention as you can, but you can definitely build a good RESTful system without P and D.

rp

like image 178
rp. Avatar answered Sep 19 '22 21:09

rp.