Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: Shortest/quickest way for Perl to take POST data it receives and send a POST request with this data to another URL?

by BrowserUk (Patriarch)
on Nov 05, 2013 at 08:07 UTC ( [id://1061263]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Shortest/quickest way for Perl to take POST data it receives and send a POST request with this data to another URL?
in thread Shortest/quickest way for Perl to take POST data it receives and send a POST request with this data to another URL?

Scripts are on different machines,

You should make that clear in your question then.

Is it under your control? Do you have NFS access to it?

If so, you could still exec it.

However, if that other machine is another web-server and you need to invoke the remote script via its url, then it makes a lie of "I don't mean that this is a redirect;", because that is exactly what a redirect does.

Clear questions get good answers.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^3: Shortest/quickest way for Perl to take POST data it receives and send a POST request with this data to another URL?

Replies are listed 'Best First'.
Re^4: Shortest/quickest way for Perl to take POST data it receives and send a POST request with this data to another URL?
by tunafish (Beadle) on Nov 05, 2013 at 08:31 UTC

    Stupid people write unclear questions!

    I meant -- I guess incorrectly -- that this is not a redirect in the HTTP sense of it. There will not be a 301, 302 or 303 HTTP response to the user's POST request. The user will not be sent to interact directly with script 2. All of this action is happening behind the scenes. The user interacts with script 1 from start to finish, but at a certain point, script 1 sends a POST request to script 2.

    Edited to add: Just re-read the original question. I did specifically ask about how to have one script send a POST request to a second script, so I'm really not sure how that was an "unclear question". I think you read into the question something that I didn't actually ask.

      Stupid people write unclear questions!

      How intelligent one is has little to no direct bearing on how well one communicates. It's a skill, not a trait.

      While as lacking in implementation specifics as your question, you have at least two answers -- zentara's and mine -- that seem to address what you want and the various proxy answers might as well. You'll either have to be much more specific, as with some sample code and expected behavior, or do some reading and experimenting with the tools you've been handed.

        If you had a single url to rewrite; and weren't already using Plack, would you really install this lot rather than write a 10-line LWP::Simple script?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

      Seems I wasn't the only one who found your question unclear.

      As a pure aside, perhaps what you want it not a formal http redirect, but rather a server rewrite. Whether your server supports it; even whether it is right for your application; I frankly neither know nor care. It's just something I encountered briefly several years ago and pass on in an 'information only' spirit.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2024-04-25 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found