title: Calling curl command from Ruby's system method
body: <p>I'm using curl command inside logstash exec plugin to post a message to a stride group. The plugin documentation stated that they were using ruby system method to execute the command, so I'm trying to run it in my ruby IRB.</p>
  
  <p>Escaping the double quotes with backslash character is giving error <code>The request body cannot be parsed as valid JSON</code>. Here is the full error</p>
  
  <blockquote>
    <p>irb(main):050:0' --inf-ruby-2f3827a9-23243-13517-726000--<br>
    curl: (6) Couldn't resolve host 'first'<br>
    curl: (3) [globbing] unmatched close brace/bracket in column 9<br>
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   165    0    87  100    78     60     54  0:00:01  0:00:01 --:--:--    60<br>
    {<br>
      "statusCode": 400,<br>
      "message": "The request body cannot be parsed as valid JSON"<br>
    }=> true  </p>
  </blockquote>
  
  <p>I tried swapping double quotes with single quotes and using full double quotes everywhere. Nothing is working.</p>
  
  <pre><code>system("curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer blah-blah' -d '{\"body\":{\"version\":1,\"type\":\"doc\",\"content\":[{\"type\":\"paragraph\",\"content\":[{\"type\":\"text\",\"text\":\"My first message!\"}]}]}}' --url 'https://api.atlassian.com/site/blah-blah/conversation/blah-blah/message'")
  </code></pre>
  
  <p>Is there any way to make this work?</p>
  
  <p><strong>EDIT:</strong> I have tried running the cURL command in the terminal and it is working fine.</p>