A RESTful API is specific for HTTP* and utlizes the following characteristics of HTTP to provide implicit caller and handler semantics:

Among other things, the goal is to not have an explosion of endpoints and to specifically avoid explicit "remote" procedure calls via URL and query parameters.

I also recommend reading the Felding's thesis on REST or at least a break down of it.

In practical terms it boils down to using something as simple as HTTP::Tiny and paying very specific attention to the request method, endpoint URL, and payload (request body). You then take the response, it'll be taken as a combination of: HTTP Status (200, 404, etc), content type header, and request body (usually as serialized JSON or XML). The latter is what you're thinking might be JSON or XML, which you extract from the response object and then deserialize using something JSON::XS.

I can't stress enough the REST is specifically defined for HTTP. Its principles can be extended to other protocols, but it will not look the same (some have tried to apply REST to things like "web sockets", all have failed).

In reply to Re: Good REST API Tutorial for Perl. by perlfan
in thread Good REST API Tutorial for Perl. by netizen

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":