我目前正在为我们国家开发基于电子商务的网站。我需要集成本地支付网关解决方案。该系统的体系结构实际上基于REST。因此,我需要post
将几个数据发送到特定url
,然后他们response
返回content
另一个url
我的应用应重定向到的url
。在事务成功/失败/取消后,第三方系统会重定向回我的应用程序URL。
现在我遇到了从我的应用重定向到第三方var result = HTTP.post(url,{params:data_me});
console.log(result.content+' ....');
的问题。
post
str.replace
方法是同步的,我正确地接收了网址。我现在如何将我的应用程序重定向到他们的回复网址。
注意:这些语句是用服务器方法编写的。我正在为我的应用程序使用铁路由器。
答案 0 :(得分:1)
您可以在客户方代码中使用onRendered
,最好将其置于location.href="http://example.com"
iron-router
或使用Router.route('/myurl', function () {
//do sth
var url = "http://example.com"
this.response.writeHead(302, {
'Location': url
});
this.response.end();
}, {
where: 'server'
});
的路由器在服务器端编写重定向标头
>>> full_list = ['first', 'second', 'third', 'fourth', 'fifth']
>>> [element for element in full_list[::2]]
['first', 'third', 'fifth']
答案 1 :(得分:0)