W
W
WotanWeb2020-01-24 18:00:16
PHP
WotanWeb, 2020-01-24 18:00:16

How to chain cURL requests in php if the second link should use the data from the first one?

Good afternoon!
The bottom line is this: you need to make a request, get a one-time token, insert it into the second link and get a response from it. If you do this with two requests in turn, it does not give back (the token is issued for 1 request).
The question is, is it possible to do this without curl_multi? If not, I would be extremely grateful if you could tell me an example of curl_multi, where data obtained from the first is inserted into the second link.
Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AUser0, 2020-01-24
@WotanWeb

This is called a persistent connection, and curl_multi() will only get in the way. Just create a connection $conn = curl_init();, quickly use it $result = curl_exec($conn);as much as you like, and then curl_close($conn);, and that's it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question