我正在使用 Classic Paypal API,但在处理请求数据之前遇到了响应问题。
public function store() {
// Send an empty HTTP 200 OK response to acknowledge receipt of the notification
response("", 200);
// Build the required acknowledgement message out of the notification just received
// Once it hits this point, nothing is sent to the client.
}
我知道为了让客户端收到 HTTP 200 响应,我需要在其前面添加 return 关键字。但是,如果我立即返回响应,则不会处理请求。我研究了中间件之前和之后,但不幸的是它们不是异步的。 Laravel 5 有什么方法可以完成 send then 过程吗?
我找到了解决这个问题的方法:
try {
return response("", 200);
} finally {
// Controller logic here
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)