What's the difference between cURL + HTTP and RESTful web services?

10,025

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.

Share:
10,025
Patr01
Author by

Patr01

We consult and build stuff out of Toronto!

Updated on June 06, 2022

Comments

  • Patr01
    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 data

    and

    b) using cURL to access RESTful web services

    Are a) and b) the same thing? Are they synonymous?