ShuiBo'blog

人生若只如初见

嗨,我是水波 (@saber).


君以国士待我,我必国士报之。

node post请求

app.post(''/chargeDiamond'', function(res) {
var msg = "";
res.setEncoding(''utf8'');
// console.log(req.body);
res.on("data", function(chunk) {
    msg += chunk;
    var modeDesc = "Player.addDiamond(diamond, cb)"
    var paramDesc = "@param cb : 前端处理回调函数" + "</br>"
                    + "@param diamond: 添加钻石数";
    var route = "connector.playerHandler.addDiamond";
    var paramList = {''diamond'': 10000};
    var json = JSON.stringify(paramList);
    setRequestDesc(modeDesc, paramDesc, route, "{}", json);
    sendRequest(route, paramList);
});
res.on("end", function() {
    console.log(msg.playerId);
})});
最近的文章

程序运行时间

//程序运行时间 $starttime = explode('' '',microtime()); echo microtime(); /*········以下是代码区·········*/ for($i=0;$i<1000000;$i++){ $i; } /*········以上是代码区·········*/ //程序运行时间 $endtime = explode('' '',microtime()); $thistime = $endtime[0]+$endtime[1]-($...…

继续阅读
更早的文章

configure: error: Cannot find php-config. Please use --with-php-config=PATH

configure: error: Cannot find php-config. Please use –with-php-config=PATH 一般出现这个错误说明你执行 ./configure 时 –with-php-config 这个参数配置路径错误导致的。 查找: find / -name php-config 修改为: ./configure –with-php-config=/usr/local/php/bin/php-config 就可...…

继续阅读