REST - why we need million urls and different HTTP request?
- by Andre
I asked this question. But I still don't understand why we need to utilize different HTTP requests: DELETE/PUT/POST/GET in order to build nice API
Wouldn't it be a lot simpler to pass all information in request parameters and have a SINGLE ENTRY-POINT for your api?:
GET www.example.com/api?id=1&method=delete&returnformat=JSON
GET www.example.com/api?id=1&method=delete&returnformat=XML
or
POST www.example.com/api {post data: id=1&method=delete&returnformat=JSON}
POST www.example.com/api {post data: id=1&method=delete&returnformat=XML}
and then - we can handle all methods and data internally without the need for hundreds of urls...
how would you call this type of API - It's not REST apparently, it's not SOAP.
then - what is it?
UPDATE
I'm not proposing any new standards here. I merely asking a question in order to better understand why web services work the way they work.