cURL'ом, php нормально обрабатывает
                  
                  
                  Запрос такой:
                  
                  
                  $ch = curl_init();
                  
                  
                  $arr = ['email' => $email, 'password' => $password];  
                  
                  
                  curl_setopt($ch, CURLOPT_URL,"http://site/send");
                  
                  
                  curl_setopt($ch, CURLOPT_POST, 1);
                  
                  
                  curl_setopt($ch, CURLOPT_POSTFIELDS, $arr);  
                  
                  
                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                  
                  
                  curl_exec($ch);
                  
                  
                  curl_close ($ch);
                  
                  
                  
                  
                  
                  Обрабатываю все на сервере node.js, данные не приходят
                  
                  
                  Обработчик:
                  
                  
                  var   express       = require("express"),    
                  
                  
                      bodyParser       = require("body-parser");
                  
                  
                  
                  
                  
                  var urlencodedParser = bodyParser.urlencoded({extended: false});
                  
                  
                  var app = express();
                  
                  
                  
                  
                  
                  app.post("/send", urlencodedParser, function (req, res) {   
                  
                  
                    var email = req.body.email,
                  
                  
                    password = req.body.password;
                  
                  
                    console.log(email, password);
                  
                  
                  });
                  
                  
                  
                  
                  
                  app.listen(80);
                  
                  
                  
                  
                  
                  Что не так? Почему данные не обрабатываются?
                  
                  
                  console.log(res.body)
                  
                  
                  тоже вообще ничего не выводит
                  
                  
                
Мидлвейр (bodyParser) неправильно прикрутил скорее всего
Обсуждают сегодня