spring mvc wrong error code (405 instead of 415) -
spring mvc wrong error code (405 instead of 415) -
i've got next (simple) controller method:
@requestmapping( value = "/testjson", method = requestmethod.post, consumes = application_json_value, produces = application_json_value) @responsebody public string testjson() { logger.info("got test"); homecoming "test"; }
when send post request url containing header "content-type=application/json" works fine.
the unusual thing is, when don't send content-type or content-type "text/plain" (still post request), next error code server: 405 method not allowed.
but expect error code: 415 unsupported media type. response header contains next line: allow: get, head not create sense too...
i right error code api. thought problem be? i'm using spring 4.1.6.release on tomcat 7.0.59.
thanks help.
spring-mvc error-code
Comments
Post a Comment