3 ms·
I've never been a big REST fan since I'm not sure that shoehorning into HTTP is a great idea. Seems like using a protocol to solve problems it was never really
by jiggy2011 15y ago
I've never been a big REST fan since I'm not sure that shoehorning into HTTP is a great idea. Seems like using a protocol to solve problems it was never really intended for.
When I am trying to connect 2 systems I prefer to think about functions rather than resources , basically create "namespaces" and have something like: www.myapp.com/api/namespace/function
then simply pass all data in using POST vars and serialize anything more complicated into JSON then just have to other end return JSON or XML.
Sometimes I will implement a simple header system with some metadata that should be sent and received with each request.
Getting too worried about POST/GET/PUT seems silly when you can just give your functions appropriate names.
I prefer to think of this as SOAP extra light.
- jiggy2011 15y agoNot sure why this is being down voted quite so hard?
- joemoon 15y agoI suspect you were being downvoted because you don't understand what REST is. I don't mean this as an insult, most people that talk about REST haven't actually read Roy Fielding's dissertation. It's a good read; I highly recommend it. If you do give it a read, you'll find that his paper isn't about "shoehorning into HTTP". Actually, the title is pretty clear: _Architectural Styles and the Design of Network-based Software Architectures_. After doing a great job of classifying different types of problems and possible solutions to these problems, Dr. Fielding describes REST as a solution to a particular kind of problem. To quote (from his blog): > REST is intended for long-lived network-based applications that span multiple organizations. If you don’t see a need for the constraints, then don’t use them. It's fine if you don't want to use REST, but it's obvious from your comment that you don't understand what REST is or when you might use it.
- jiggy2011 15y agoThanks, I've got that bookmarked and will give it a read when I get some time. I apologize if I have mis-represented the arguments for/against REST it's just my experience that a lot of debate around REST seems to be people discussing which resource something should belong to or whether something should be POST or PUT. These sorts of conversations don't really make your software better (I often feel the same way about OO inheritance).