Changes between Version 67 and Version 68 of XmlRpcPlugin


Ignore:
Timestamp:
Oct 29, 2008, 2:34:42 PM (16 years ago)
Author:
Christopher Sexton
Comment:

Added a ruby xmlrpc/client example

Legend:

Unmodified
Added
Removed
Modified
  • XmlRpcPlugin

    v67 v68  
    175175You can either use the XMLRPC functionality included in the [http://ruby-doc.org/stdlib/libdoc/xmlrpc/rdoc/index.html Ruby Standard Library] or [/attachment/wiki/XmlRpcPlugin/trac4r.tar.gz download the trac4r library] which does all the trivial stuff for you.
    176176
     177==== trac4r Example ====
    177178This example uses trac4r:
    178179{{{
     
    225226If you have any problems with trac4r you can email me: niklas.cathor (eat) gmail dot com
    226227
     228==== xmlrpc Example ====
     229
     230An example using XML-RPC directly with Ruby to append to a wiki page:
     231{{{
     232#!ruby
     233require 'xmlrpc/client'
     234user = "username"
     235password = "password"
     236page_name = "SandBoxRPC"
     237new_content = "\n\nMy new content"
     238new_comment = "Adding new content from ruby"
     239
     240server = XMLRPC::Client.new2("https://#{user}:#{password}@trac.server.com/trac/login/xmlrpc")
     241content = server.call("wiki.getPage", page_name) + new_content
     242server.call("wiki.putPage", page_name, content, {"comment" => new_comment})
     243}}}
     244
    227245=== API Usage ===
    228246