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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -