What's the difference between cURL + HTTP and RESTful web services?
Solution 1
I'm not sure I understand the significance of "on the server side", please elaborate if there is any. Otherwise:
Accessing a RESTful web service consists of accessing an URL via HTTP, so b, is really a subset of a.
When done right, the client usually needs to issue multiple GET request to "drill down" to the specific resource it intends to work with. Then it may cache the specific URL, but hard-coding it or constructing it on the client side is not considered elegant.
Solution 2
The only difference is whether the action invoked by the URL is a RESTful service. If the action depends on storing or retrieving state from a cookie or hidden field, then it isn't really RESTful. I don't know if this makes a difference to you, in your case it probably only determines the kind of error response you get back. RESTful services also have conventions regarding how they behave when they receive a GET or PUT instead of a POST, which may matter if you're trying to interact with a system instead of just interrogate it for some data.
Comments
-
Patr01 almost 2 years
I don't understand the difference between
a) on the server side initiating a cURL connection and transmit POST information to
http://somesite.com/action
and receiving XML dataand
b) using cURL to access RESTful web services
Are a) and b) the same thing? Are they synonymous?