REST - why we need million urls and different HTTP request?
Posted
by
Andre
on Stack Overflow
See other posts from Stack Overflow
or by Andre
Published on 2011-01-01T18:25:10Z
Indexed on
2011/01/01
18:54 UTC
Read the original article
Hit count: 219
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.
© Stack Overflow or respective owner