Answer the question
In order to leave comments, you need to log in
What is the best way to make GET requests for node.js to a php server?
I need to make get requests to the server in php. What is the best package to do this?
Answer the question
In order to leave comments, you need to log in
var http = require('http');
var req = http.request({
host: 'hostname.com',
path: '/path/file.php?par=1&min=1'
}, function(res) {
var result = '';
res.on('data', function (chunk) { result += chunk; });
response.on('end', function () { console.log(result); });
});
req.end();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question