user2686602 user2686602 - 1 year ago 66
Perl Question

Perl : Json : Can I perform a GET within my POST processing?

In theory... is it possible to
parse a POST payload in which a url is supplied,
then use the supplied url to perform a GET to acquire data,
that data is used to query a db and
then send my response to the POST?
Or will my original POST request pick up the GET response and kill everything?

I can't seem to find an example or reference to this being done anywhere...

Answer Source

Yes, it's possible, and not just in theory. I've done much the same thing myself. Just use LWP (or your preferred HTTP client library) to perform the GET as usual. Whether you're doing it within a POST handler or not makes no difference.