Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Good REST API Tutorial for Perl.

by hippo (Chancellor)
on Oct 29, 2020 at 21:56 UTC ( #11123299=note: print w/replies, xml ) Need Help??


in reply to Good REST API Tutorial for Perl.

What I understand as of now, is that REST API is something like a call I make to a website and give me the results in the json format, that's all.

Not quite. Firstly, there is no requirement for REST to use JSON although many instances do. Secondly, REST is more specific in that it stipulates the creation, deletion and modification of data items via a structured path. The HTTP methods are respected as are HTTP status codes - REST therefore necessarily builds on HTTP. There is plenty of detailed documentation on the web about what REST is and what it isn't (eg https://en.wikipedia.org/wiki/Representational_state_transfer#Architectural_constraints).

If you could direct me to a good tutorial that teaches REST API using Perl, I will be ever so thankful.

Do you want to build a client or a server?


🦛

Replies are listed 'Best First'.
Re^2: Good REST API Tutorial for Perl.
by netizen (Novice) on Oct 30, 2020 at 00:25 UTC

    Hi Hippo,

    Thanks for the clarity. In my case, the Server is already there. Its device that has REST APIs available. I need to build something that will "connect" to it and get the output.

      REST::Client will get you started.

      There are many more clients for specialized REST services - if you are using a well-known REST server, you will be better off using a pre-written specialized client.

      Here is a brief Rest::Client tutorial.

                      "Imaginary friends are a sign of a mental disorder if they cause distress, including antisocial behavior. Religion frequently meets that description"

        I recommend HTTP::Tiny. A client need not be over complicated and it's a good exercise for someone learning the nuances of interfacing with a RESTful API.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11123299]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2021-01-20 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?