Response status text empty
Using Resteasy for my web services
Not seeing the response text in Firefox or wget despite being able to convert the status test when using the Jarkarta HTTP client built into Resteasy. For example, if I return a 403 forbidden when the user tries to post (create) an object that already exists the response "text" is missing:
sadbmatrix2@(wm516)-> wget --post-file .... "http://sadbmatrix2:55167/CMDB/resteasy/element"
HTTP request sent, awaiting response...
HTTP/1.1 403 Forbidden
Connection: Keep-Alive
Date: Sat, 15 Jan 2011 18:41:36 GMT
Content-Length: 166
Content-Type: text/plain
2011-01-15 19:41:41 ERROR 403: Forbidden.
Have tried setting the media type in the response to text/html, text/xml, and text/plain but nothing is visible in the response despite the context length being 166 characters long. If I issue a http get that results in a 404 not found I see the status text sent by my application (using an ExceptionMapper). Weird.
Wonder if I am misunderstanding a fundamental aspect of HTTP responses whereby certain status types have no excepted text by the recipient? Otherwise why wou开发者_C百科ld the 404 show in Firefox. The exact same request that yields are not found via wget doesn't show a thing.
精彩评论