request.env

@client_ip = request.env["HTTP_X_FORWARDED_FOR"] #取得使用者的IP地址
@client_browser = request.env["HTTP_USER_AGENT"] #取得使用者浏览器信息
@http_referer = request.env["HTTP_REFERER"] #取得使用者來源(referer)
@client_language = request.env["HTTP_ACCEPT_LANGUAGE"] #取得使用者支持的语言
@server_port = request.env["SERVER_PORT"]
@request_uri = request.env["REQUEST_URI"]
@content_length = request.env["CONTENT_LENGTH"].to_i
@rails_relative_url_root = request.env["RAILS_RELATIVE_URL_ROOT"]
@script_name = request.env["SCRIPT_NAME"]
@request_method = request.env["REQUEST_METHOD"]
@path_info = request.env["PATH_INFO"]
@query_string = request.env["QUERY_STRING"]
@server_software = request.env["SERVER_SOFTWARE"]
@https = request.env["HTTPS"]
@potocol = request.env["HTTP_X_FORWARDED_PROTO"]
@content_type = request.env["CONTENT_TYPE"]

你可能感兴趣的:(浏览器,Rails)