title: Convert CURL request to RestClient request
body: <p>I have a curl request to fetch data from elasticsearch </p>
  
  <pre><code>curl -XGET "http://localhost:9200/_all/_search?search_type=count&amp;q=_type:invoice" -d '
      {
      "aggs" :
          {
              "by_index" :
                  {"terms" : {"field" : "_index"}},
              "aggs" :
                  {"by_state" : {"terms" : {"field" : "state"}}}
          }
  }'
  </code></pre>
  
  <p>I works fine from terminal, now in application i was to use this request.</p>
  
  <p>I am using <a href="https://github.com/rest-client/rest-client" rel="nofollow">RestClient</a> to send a GET request:</p>
  
  <pre><code>RestClient.get curl -XGET "http://localhost:9200/_all/_search?search_type=count&amp;q=_type:invoice"
  </code></pre>
  
  <p>How can i pass the filters to it like i did in curl request ?</p>