简体   繁体   English

Rest API获取POST请求而不是GET

[英]Rest API getting POST request instead of GET

I am new to the spring boot rest API and but I am stuck that when POST request comes for any implemented GET API then what Exception class and error code need to be returned in the response. 我是Spring Boot Rest API的新手,但我陷入困境,当对任何已实现的GET API发出POST请求时,则需要在响应中返回什么Exception类和错误代码。 Any help is appreciated 任何帮助表示赞赏

Quoting from queston: 从问题中引用:

when POST request comes for any implemented GET API 对任何已实现的GET API发出POST请求时

You can't request by an invalid HTTP method for a specific endpoint. 您不能通过无效的HTTP方法来请求特定端点。 For that you will get 为此,你会得到

405 Method Not Allowed

You don't have to handle that from your server side. 您不必从服务器端进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM