我有以下电话:
$http.get(
'../api/hello', {
params: {
hello: "world"
}
}).then(function (res) {
//do response
})
和以下路线:
server.route({
path: '/api/hello',
method: 'GET',
handler(req, reply) {
//get hello
}
})
我正在尝试在“//get hello”上获取名为“hello”的参数。我曾尝试使用“req.params”,但它返回 {}。
调用有什么问题或者我怎样才能得到 hello 参数?提前致谢