26 July 2006 0 comments Linux
This blog post is 16 years old! Most likely, its content is outdated. Especially if it's technical.
Just figured out how to call my slim web service via XML-RPC using Ruby. It's as easy as in Python.
Here's the code:
require "xmlrpc/client"
# Make an object to represent the XML-RPC server.
server = XMLRPC::Client.new( "www.peterbe.com", "/")
# Call the remote server and get our result
result = server.call("slim", "h1 { font-family: Arial;}","css")
puts result
result = server.call("slim",
"function add(var1, var2) { return var1 + var2; }","js")
puts result
And when you run this on the command line this is what you get:
$ ruby dummy.rb
h1{font-family:Arial}
function add(_0,_1){return _0 + _1;}
- Previous:
- slim, a new free web service for white space optimisation 25 July 2006
- Next:
- Exploding Dell laptops 31 July 2006
- Related by category:
- Linux tip: du --max-depth=1 27 September 2007 Linux
- How to create-react-app with Docker 17 November 2017 Linux
- Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018 Linux
- set -ex - The most useful bash trick of the year 31 August 2014 Linux
- Run something forever in bash until you want to stop it 13 February 2018 Linux
- Related by keyword:
- Ruby and Python benchmarked 25 September 2005