instance method xml_http_request

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

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. Keys are automatically upcased and prefixed with ‘HTTP_’ if not already.

Parameters

request_method req
path req
parameters opt = nil
headers opt = nil
Source
# File actionpack/lib/action_controller/integration.rb, line 215
      def xml_http_request(request_method, path, parameters = nil, headers = nil)
        headers ||= {}
        headers['X-Requested-With'] = 'XMLHttpRequest'
        headers['Accept'] ||= 'text/javascript, text/html, application/xml, text/xml, */*'

        process(request_method, path, parameters, headers)
      end

Defined in actionpack/lib/action_controller/integration.rb line 215 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Integration::Session

Type at least 2 characters to search.

↑↓ navigate · open · esc close