You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "PlasticJonbenetDoll (via GitHub)" <gi...@apache.org> on 2023/10/24 10:36:26 UTC
[I] help request: is it possible to return custom response if the wrong method was called? [apisix]
PlasticJonbenetDoll opened a new issue, #10387:
URL: https://github.com/apache/apisix/issues/10387
### Description
So I have a question. Is it possible to return custom response if the wrong method was called?
For example route's method was GET but client sent POST request.
Currently apisix returns Route not Found, but I want to make different resopnse based on used method.
### Environment
- APISIX version (run `apisix version`): 3.5
- Operating system (run `uname -a`): Red Hat
- OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
- etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
- APISIX Dashboard version, if relevant:
- Plugin runner version, for issues related to plugin runners:
- LuaRocks version, for installation issues (run `luarocks --version`):
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1851539408
I will close this issue, feel free to reopen it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed issue #10387: help request: is it possible to return custom response if the wrong method was called?
URL: https://github.com/apache/apisix/issues/10387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed issue #10387: help request: is it possible to return custom response if the wrong method was called?
URL: https://github.com/apache/apisix/issues/10387
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "PlasticJonbenetDoll (via GitHub)" <gi...@apache.org>.
PlasticJonbenetDoll commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1780389772
Thanks for reply. Can you show an example of how serverless plugin can do that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1851538766
Maybe you could configure a router with the wrong method, and return custom response in the router
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1784388594
I'm sorry I misunderstood your query. This isn't supported yet, could you raise a PR for this? Let me know if you need any help.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1786407773
> For example route's method was GET but client sent POST request.
> Currently apisix returns Route not Found, but I want to make different resopnse based on used method.
You would just create a route to match POST and return an error message. Consider using the `response-rewrite` plugin.
IMHO this should not be a new feature. Because what happens if someone needs to match to different destinations for GET and POST methods?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1777019683
you can use the serverless plugin to do this setup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] help request: is it possible to return custom response if the wrong method was called? [apisix]
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on issue #10387:
URL: https://github.com/apache/apisix/issues/10387#issuecomment-1851535896
Not supported yet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org