in reply to Sample REST request & response code
Hi, there's sample code in the documentation of any decent CPAN module, in the SYNOPSIS as well as in the test files. Larger platforms such as web application servers typically offer expansive documentation. Which have you looked at so far?
I recommend using Dancer2 to serve your REST API, and you might like REST::Client for making requests to it.
Server:
Client:use Dancer2; get '/' => sub { "Hello World" }; dance;
use REST::Client; my $client = REST::Client->new(); $client->GET('http://localhost:3000/'); print $client->responseContent();
Hope this helps!
|
|---|