【发布时间】:2015-06-11 02:27:18
【问题描述】:
我正在使用 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 中完成发送然后处理?
【问题讨论】:
-
异步是什么意思?这不起作用 - laravel.com/docs/5.8/middleware#terminable-middleware ?