S
S
Sergo Sergo2015-06-08 22:11:19
Node.js
Sergo Sergo, 2015-06-08 22:11:19

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

3 answer(s)
S
SagePtr, 2015-06-08
@SagePtr

There is a convenient request package

O
OnYourLips, 2015-06-08
@OnYourLips

It is better to use special protocols. For example SOAP.

T
Timur Shemsedinov, 2015-06-08
@MarcusAurelius

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 question

Ask a Question

731 491 924 answers to any question