Js simulates sending post requests.

  node.js, question

Node.js sends post requests with 400 errors
solve

var http = require('http');
 var querystring = require('querystring');
 Stringify (//serialize an object
 phone: '18764285761',
 sn: '123456',
 mac:'test'
 });
 var option = {
 method: 'post',
 host: 'edu.ishenka.com',
 prot: '80',
 path: '/frontend/web/index.php?  r=/test/index',
 Headers: {// Required Information
 "Content-Type":"application/x-www-form-urlencoded;  charset=UTF-8",
 "content-length": contents.length,//request length, calculated from above
 bracket
 };
 var Dispose = function(response){
 var body='';
 response.on('data',function(data){
 Body plus = data;
 });
 response.on('end',function(){
 console.log(body);
 });
 };
 var req = http.request(option,Dispose);
 req.write(contents);  //Send content
 req.end();

HTTP 400 meansBad Request, i.e.Parameter error. Perhaps the parameters you provided do not meet the requirements of the backend, you can get more information by looking at response.