class Sinatra::Request

rack.rubyforge.org/doc/classes/Rack/Request.html<br>The request object. See Rack::Request for more info:

def accept

Returns an array of acceptable media types for the response
def accept
  @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.split(';')[0].strip }
end

def secure?

using SSL to communicate with the client.
Whether or not the web server (or a reverse proxy in front of it) is
def secure?
  @env['HTTPS'] == 'on' or
  @env['HTTP_X_FORWARDED_PROTO'] == 'https' or
  @env['rack.url_scheme'] == 'https'
end