PHP'den alınan bilgi nasıl Node.js'e gönderilir?

PHP Curl modülünü kullanarak veriyi gönderebilirsin.
Örnek:
[CODE lang="php" title="PHP Curl"]$data = [
"ids" => 1,2,3,4,5
];

$postData = http_build_query($data);

$ch = curl_init("http://www.example.com/");
// veya
$ch = curl_init("http://localhost/");

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);

curl_exec($ch);

if(curl_error($ch)) {
fwrite($fp, curl_error($ch));
}
curl_close($ch);
[/CODE]
 
Request ve response mantığı ile çalışman gerek. Node.js ile PHP uygulamana istek atabilirsin. Bunun için Axios kütüphanesi var.
 

Geri
Yukarı