Method: ActionDispatch::Request#xml_http_request?
- Defined in:
- lib/action_dispatch/http/request.rb
#xml_http_request? ⇒ Boolean Also known as: xhr?
Returns true if the X-Requested-With header contains “XMLHttpRequest” (case-insensitive), which may need to be manually added depending on the choice of JavaScript libraries and frameworks.
305 306 307 |
# File 'lib/action_dispatch/http/request.rb', line 305 def xml_http_request? /XMLHttpRequest/i.match?(get_header("HTTP_X_REQUESTED_WITH")) end |