I have a script that does this:
require 'rubygems'
require 'rest-client'
require 'json'
url = foo
request = bar
response = RestClient.post(url,request, :content_type => :json, :accept => :json)
I am trying to test the API I am using for reliablity and want to send it four requests at the same time. I have been trying to do this using four terminal windows. But this is a bit tricky – so there must be a better way to do this.
Could this be done with threading? If so how? And is threading the best way to do it. Not all of the requests will be same.
With threach you can write
and it should work as intended.