Thanks Chris Heald for your response. I did end up using Net::HTTP because it was more straightforward than I thought it was in the end. HTTParty looks like it could make this easier still, but for the benefit of future people with this problem, here's what I did.
# Assume @user_name and @password were previously declared to be the
# appropriate basic auth values and that the connection is open as @connection
def put(path, body, header={})
request = Net::HTTP::Put.new(path, header.merge({'Accept' => 'application/xml,application/json', 'Content-type'=>'application/json'}))
request.basic_auth(@user_name, @password)
@connection.request(request, body).body
end
def post(path, body, header={})
request = Net::HTTP::Post.new(path, header.merge({'Accept' => 'application/xml,application/json', 'Content-type'=>'application/json'}))
request.basic_auth(@user_name, @password)
@connection.request(request, body).body
end
def get(path, header={})
request = Net::HTTP::Get.new(path)
request.basic_auth(@user_name, @password)
@connection.request(request).body
end
I then called JSON::parse() on the output of these methods and got a hash representing the JSON that I could use as I saw fit.