Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Rest API listener (simple)

by VinsWorldcom (Prior)
on Feb 01, 2017 at 21:47 UTC ( [id://1180802]=note: print w/replies, xml ) Need Help??


in reply to Rest API listener (simple)

If that's the case, you probably just need a web server. There are modules that do this (HTTP::Server::Simple) but if internet access is an issue, CPAN install may be also. You could always Google "perl simple web server" and you'll find ways to code it up with IO::Socket - standard core module.

Replies are listed 'Best First'.
Re^2: Rest API listener (simple)
by sans-clue (Beadle) on Feb 02, 2017 at 00:10 UTC
    I do have a simple webserver that has cgi capability called thttpd. I use it extensively to perform quasi rexec functions. I just wasn't sure how I would capture a webhook notification and send back an OK. Thanks

      Whatever CGI-based Perl module you are already using for your "quasi rexec functions" will have documentation on how to extract the body of a POSTed request. Refer to that for the details (or if you cannot find or understand the documentation, then reply here with specifics such as which module you are using and which version). Then it's just a matter of dumping it to a file and printing the appropriate headers and body back to the client which should be straightforward.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-26 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found