If say, a resource need not support PUT requests as it will never be updated, I may choose to simply not implement PUT. My expectation then is that people attempting to perform a PUT request on this resource is that they receive a 405 HTTP status code in response, and that's precisely what happens. Unfortunately, I don't believe ServiceStack is fully following the HTTP specification as the Allow headers are absent.
The specification:
10.4.6 405 Method Not Allowed
The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.
When I perform a PUT on my resource which only includes GET and POST as options, I see this:
Status Code: 405
Date: Thu, 26 Apr 2012 01:06:50 GMT
X-AspNet-Version: 4.0.30319
X-Powered-By: ServiceStack/3.69 Win32NT/.NET
Connection: Close
Content-Length: 0
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: private
There is no Allow header, which I believe is distinct from Access-Control-Allow-Methods as that's for cross-domain nonsense.
I could probably work around this, but it felt more like SS just missed a step.
Thanks as always
Michael