We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I define custom matching routes and specify HTTP method for them, so that I'm able to access to specified route with any HTTP method.
Example of router definitions:
$apiRouter[] = new Routers\Route( 'api/message[/<action>]', 'Messages:Webhook:default', [ 'methods' => [ Nette\Http\Request::POST => 'click', Nette\Http\Request::POST => 'deliver' ] ]);
And presenter:
class WebhookPresenter extends UI\Presenter { public function actionClick() { $this->sendJson([ 'presenter' => 'Api:Message:Message', 'action' => 'click', 'timestamp' => time() ]); } public function actionDeliver() { $this->sendJson([ 'presenter' => 'Api:Message:Message', 'action' => 'deliver', 'timestamp' => time() ]); } }
If I try to call URL via cURL with POST, I'll get correct response: {"presenter":"Api:Message:Message","action":"deliver","timestamp":1480584275}
{"presenter":"Api:Message:Message","action":"deliver","timestamp":1480584275}
But, if I call it with GET method, I'll get same response. FORBIDDEN or BAD_REQUEST is expected
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When I define custom matching routes and specify HTTP method for them, so that I'm able to access to specified route with any HTTP method.
Example of router definitions:
And presenter:
If I try to call URL via cURL with POST, I'll get correct response:
{"presenter":"Api:Message:Message","action":"deliver","timestamp":1480584275}
But, if I call it with GET method, I'll get same response. FORBIDDEN or BAD_REQUEST is expected
The text was updated successfully, but these errors were encountered: