Created
April 21, 2018 11:43
-
-
Save bluemoon2014/01ce8881a24d097f93320713bbee2eb6 to your computer and use it in GitHub Desktop.
发射内部调用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var options = { | |
method: 'post', | |
url: "http://127.0.0.1:2000/publicInterface/login", | |
form: {userName:"admin",password : 123456}, | |
headers: { | |
'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
}; | |
var fs = require("fs"); | |
request(options, function (err, res, body) { | |
if (err) { | |
console.log(err) | |
}else { | |
console.log("j进啦"); | |
var result = JSON.parse(body); | |
console.log(result); | |
fs.writeFileSync("./global.txt", result.data); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment