use set_form_data to send query string and a fix for ruby 1.9

I was having trouble getting regular expression matching to work when using fact_filters with the rpcclient.  Before, it was sending the query using GET /v2/nodes?query=.... but puppetdb (I'm using 1.4) wants a GET with parameters in the body like a POST (apparently).

This patch fixes that, and as a by-product also sets the content-type field.  With the patch I can query with regular expressions as well as with straight matching filters.

The line
data = resp.body if data.nil?
is a fix for ruby 1.9 putting the data in the response body.  This should probably be part of a separate pull request?