Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 0.28 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. require 'rest_client'
  2. require 'json'
  3.  
  4. def add_to_web
  5.   params = {
  6.     things: {
  7.       item1: "value1",
  8.       item2: "value2",
  9.       item3: "value3"
  10.     }
  11.   }
  12.   request = RestClient.post "http://localhost:3000/someresource/", params.to_json, :content_type => :json, :accept => :json
  13. end