Class | Rack::Accept::Response |
In: |
lib/rack/accept/response.rb
|
Parent: | Rack::Response |
The base class for responses issued by Rack::Accept.
Marks this response as being unacceptable and clears the response body.
Note: The HTTP spec advises servers to respond with an "entity" that describes acceptable parameters, but it fails to go into detail about its implementation. Thus, it is up to the user of this library to create such an entity if one is desired.
# File lib/rack/accept/response.rb, line 12 12: def not_acceptable! 13: self.status = 406 14: self.body = [] 15: header['Content-Length'] = '0' 16: end