instance method
xml_http_request
Ruby on Rails 3.2.22.5
Since v3.0.20 Last seen in v4.2.9Signature
xml_http_request(request_method, path, parameters = nil, headers = nil)
Performs an XMLHttpRequest request with the given parameters, mirroring a request from the Prototype library.
The request_method is :get, :post, :put, :delete or :head; the parameters are nil, a hash, or a url-encoded or multipart string; the headers are a hash.
Parameters
-
request_methodreq -
pathreq -
parametersopt = nil -
headersopt = nil
Source
# File actionpack/lib/action_dispatch/testing/integration.rb, line 66
def xml_http_request(request_method, path, parameters = nil, headers = nil)
headers ||= {}
headers['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'
headers['HTTP_ACCEPT'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')
process(request_method, path, parameters, headers)
end
Defined in actionpack/lib/action_dispatch/testing/integration.rb line 66
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Integration::RequestHelpers