How to implement this using PHP?

Task.

There is a Client, Server1, Server2. Client POST sends a request with data to Server1. Server1 processes the data and sends a subquery to Server2 (and at the same time it is not responding to Server1 yet). After receiving a response from Server2, Server1 generates a response and sends it to the Client.

Preferred sample code.

    1 answer 1

    Just on one and the other servers php scripts processing input data and giving the answer. At the first one, it will simply be still in the body of the document the function of the request with the transfer of data to the second. Honestly, I do not see any difficulties at all here. Unless you do not know how from pkhp to do POST request.