Flowdock
method

web_client_api

Importance_2
v1.2.6 - Show latest stable - 0 notes - Class: ActionWebService::Container::ActionController::ClassMethods
web_client_api(name, protocol, endpoint_uri, options={}) public

Creates a client for accessing remote web services, using the given protocol to communicate with the endpoint_uri.

Example

  class MyController < ActionController::Base
    web_client_api :blogger, :xmlrpc, "http://blogger.com/myblog/api/RPC2", :handler_name => 'blogger'
  end

In this example, a protected method named blogger will now exist on the controller, and calling it will return the XML-RPC client object for working with that remote service.

options is the set of protocol client specific options (see a protocol client class for details).

If your API definition does not exist on the load path with the correct rules for it to be found using name, you can pass in the API definition class via options, using a key of :api

Show source
Register or log in to add new notes.