在rails中我向我的服务器发出POST请求:
response = Typhoeus::Request.post("http://url.localtunnel.com/request?from=ola&to=ole")
result = JSON.parse(response.body)
在Node.js应用程序中,我想阅读From和To:
app.post '/request', (req,res) ->
console.log "I have received a request, sweet!!"
sys.log req.params.from
#sys.log "From: " + req.from + ", To: " + req.to + ", Id: " + req.id
我该怎么做?
谢谢
解决方法:
答案是:
Checks query string params (req.query), ex: ?id=12