Skip to content

Instantly share code, notes, and snippets.

@jasonlyles
Created October 16, 2009 18:33
Show Gist options
  • Save jasonlyles/211959 to your computer and use it in GitHub Desktop.
Save jasonlyles/211959 to your computer and use it in GitHub Desktop.
url = URI.parse('http://report1.atbackup.local/servers/create')
req = Net::HTTP::Post.new(url.path)
req.content_type='text/xml'
req.body = "<?xml version='1.0' encoding='UTF-8'?><server><hostname>#{localhost.hostname}</hostname><netmask>#{localhost.netmask}</netmask></server>"
res = Net::HTTP.new(url.host, url.port).start{|http| http.request(req)}
puts res.code
puts res.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment