request的小问题
结贴是美德 2012-01-11 04:42:53 我再看Tomcat的API时,发现这么一段话:
getContentType
java.lang.String getContentType()
Returns the MIME type of the body of the request, or null if the type is not known. For HTTP servlets, same as the value of the CGI variable CONTENT_TYPE.
Returns:
a String containing the name of the MIME type of the request, or null if the type is not known
地址为:http://tomcat.apache.org/tomcat-7.0-doc/servletapi/index.html
但是呢,我的工程中调用getContentType总是返回null,通过firfox的插件查看
头信息,确实也没有content-type这一项。浏览器发送的http消息能有body和content-type么? 什么时候才有?