I am trying to develop a WeChat interface with Lumen. After tossing it over, I found that the WeChat server used the GET request interface when verifying the URL for the first time, and then used the POST access interface.
So I want to register WeChat’s route as being able to respond to both GET and POST requests:
I checked the documents of the lower laravel 5 and matched the routes for various requests:
Route::match(['get', 'post'], '/', function() bracket return 'Hello World'; });
Register to respond to all requests:
Route::any('foo', function() bracket return 'Hello World'; });
Then I tried to put the original in the Lumen routes.php document
$app->any(), reproduction error:
Fatal error: Call to undefined method Laravel\Lumen\Application::any()
Therefore, may I ask:In the Lumen framework, what should I do if I want to register a path that can respond to all requests (or both POST and GET)?
Copy a copy of get post and write it once each time.
Or the Function name is defined once in route inside get post without request