title: How to convert a hash to JSON without the converted string being full of backslashes
body: <p>I am converting a hash to JSON using <code>to_json</code>, but the converted string is full of backslashes. If I use <code>puts</code>, it  shows the correct string but if I pass in a <code>HTTP::NET request.body</code>, the string is full of backslashes.</p>
  
  <pre><code>data = {"a" =&gt; "b", "c" =&gt; "d", "e" =&gt; "f"}
  http = Net::HTTP.new(uri.host, uri.port)
  req = Net::HTTP::Post.new(uri.path, {'Content-Type' =&gt;'application/json', 
            'Authorization' =&gt; "xyz")
  req.body = data.to_json
  res = http.request(req)
  </code></pre>
  
  <p><code>req.body</code> is sending:</p>
  
  <pre><code>"{\"a\":\"b\",\"c\":\"d\",\"e\":\"f\"}"
  </code></pre>
  
  <p>My request is failing because of this. </p>
  
  <p>I need to send data as</p>
  
  <pre><code>"{"a" =&gt; "b", "c" =&gt; "d", "e" =&gt; "f"}"
  </code></pre>
  
  <p>in the request body.</p>