router.post(’/news’, function(req, res) { console.log(req.body); var queryStr = qs.stringify(req.body); request(’http://x.x.x.x:8080/cms/f/articleDetails?’+ queryStr,function (error, response, body) { if (!error && response.statusCode == 200) { var data = JSON.parse(body); var resString = { title:data.result[0].title, content:data.result[0].content, createDate:data.result[0].createDate, copyfrom:data.result[0].copyfrom, image:data.result[0].image } console.log(resString) res.render(‘news’,resString,function(err,str){ var msg = err || str console.log(msg) });
}
})
}); chrom报错 14586: URL_REQUEST http://127.0.0.1:3000/news Start Time: 2015-12-18 14:49:40.676
t=558570 [st= 0] +REQUEST_ALIVE [dt=18773] t=558570 [st= 0] URL_REQUEST_DELEGATE [dt=0] t=558570 [st= 0] +URL_REQUEST_START_JOB [dt=18772] –> load_flags = 78082 (BYPASS_CACHE | MAIN_FRAME | MAYBE_USER_GESTURE | REPORT_RAW_HEADERS | VERIFY_EV_CERT) –> method = “POST” –> priority = “HIGHEST” –> upload_id = “1450418177369404” –> url = "http://127.0.0.1:3000/news" t=558571 [st= 1] URL_REQUEST_DELEGATE [dt=0] t=558571 [st= 1] HTTP_CACHE_GET_BACKEND [dt=0] t=558571 [st= 1] HTTP_CACHE_DOOM_ENTRY [dt=0] –> net_error = -2 (ERR_FAILED) t=558571 [st= 1] HTTP_CACHE_CREATE_ENTRY [dt=0] t=558571 [st= 1] HTTP_CACHE_ADD_TO_ENTRY [dt=0] t=558571 [st= 1] URL_REQUEST_DELEGATE [dt=0] t=558571 [st= 1] +HTTP_STREAM_REQUEST [dt=2] t=558571 [st= 1] HTTP_STREAM_REQUEST_STARTED_JOB –> source_dependency = 14588 (HTTP_STREAM_JOB) t=558573 [st= 3] HTTP_STREAM_REQUEST_BOUND_TO_JOB –> source_dependency = 14588 (HTTP_STREAM_JOB) t=558573 [st= 3] -HTTP_STREAM_REQUEST t=558573 [st= 3] +HTTP_TRANSACTION_SEND_REQUEST [dt=2] t=558573 [st= 3] HTTP_TRANSACTION_SEND_REQUEST_HEADERS –> POST /news HTTP/1.1 Host: 127.0.0.1:3000 Connection: keep-alive Content-Length: 35 Pragma: no-cache Cache-Control: no-cache Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 Origin: http://127.0.0.1:3000 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5 Content-Type: application/x-www-form-urlencoded Referer: http://127.0.0.1:3000/ Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8 Cookie: [30 bytes were stripped] t=558573 [st= 3] HTTP_TRANSACTION_SEND_REQUEST_BODY –> did_merge = true –> is_chunked = false –> length = 35 t=558575 [st= 5] -HTTP_TRANSACTION_SEND_REQUEST t=558575 [st= 5] +HTTP_TRANSACTION_READ_HEADERS [dt=18767] t=558575 [st= 5] HTTP_STREAM_PARSER_READ_HEADERS [dt=18767] –> net_error = -101 (ERR_CONNECTION_RESET) t=577342 [st=18772] -HTTP_TRANSACTION_READ_HEADERS –> net_error = -101 (ERR_CONNECTION_RESET) t=577342 [st=18772] -URL_REQUEST_START_JOB –> net_error = -101 (ERR_CONNECTION_RESET) t=577342 [st=18772] URL_REQUEST_DELEGATE [dt=0] t=577343 [st=18773] -REQUEST_ALIVE –> net_error = -101 (ERR_CONNECTION_RESET)