Answer the question
In order to leave comments, you need to log in
How to send value to php_curl like console -d?
I do. request via console in ElasticSearch:
curl -XPOST ' localhost:9200/events/play/_bulk ' -d '
{"metadata": {}}
{"element": 1}'
How to send what is passed after -d in PHP with using the php_curl extension?
$c = curl_init();
$opts = [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $address,
CURLOPT_BINARYTRANSFER => true,
CURLOPT_POST => true,
// CURLOPT_POSTFIELDS = [], // ???
];
curl_setopt_array($c, $opts);
$res = curl_exec($c);
curl_close($c);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question