Level 58
You can use the Guzzle HTTP client to make an API request and then send the data from the response to your ZMQ block.
First, install Guzzle with Composer:
composer require guzzlehttp/guzzle
Then, you can use the following code to make an API request and send the response data to your ZMQ block:
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://example.com/api/endpoint');
$data = $response->getBody()->getContents();
$queue = new ZMQSocket(new ZMQContext(), ZMQ::SOCKET_REQ);
$queue->connect("tcp://127.0.0.1:6116");
$queue->send($flag, ZMQ::MODE_SNDMORE);
$queue->send($data, ZMQ::MODE_NOBLOCK);
$abc = $queue->recvMulti();
1 like