title: Ruby: PUT Request with JSON body?
body: <p>I need to create an <strong>HTTP PUT request</strong> using ruby. </p>
  
  <p>The request has a <strong>JSON body</strong></p>
  
  <p>I was able to generate the JSON body using:</p>
  
  <pre><code>require 'rubygems'
  require 'json'
  jsonbody = JSON.generate["message"=&gt;"test","user"=&gt;"user1"]
  </code></pre>
  
  <p>I need to send this PUT request to the url: </p>
  
  <pre><code>require 'open-uri'
  url = URI.parse('http://www.data.com?access_token=123')
  </code></pre>
  
  <p>Can someone please tell me how I can do this in Ruby?</p>