Ruby: Debugging and Testing APIs and Backend Services with Runscope

The Runscope Traffic Inspector lets you see all of the API requests and responses you're sending and receiving from your code. To capture the requests, create a Gateway URL for the API you're calling. Below are some examples for using the Gateway URL with your favorite HTTP client.

Net::HTTP POST Request Example Library Docs

require "net/http"
require "uri"

uri = URI.parse("")

http =, uri.port)

request =
request.set_form_data({"foo" => "bar", "fizz" => "buzz"})

response = http.request(request)

HTTParty POST Request Example Library Docs

require httparty
response ="", 
                         :query => { :foo => "bar" })
puts response.body, response.code, response.message, response.headers.inspect

Typhoeus POST Request Example Library Docs"", body: { foo: "bar" })

Faraday POST Request Example Library Docs

conn = => '') do |faraday|
  faraday.request  :url_encoded             # form-encode POST params
  faraday.adapter  Faraday.default_adapter  # make requests with Net::HTTP
end '/api', { :name => 'Maguro' }

Need help? We have you covered.

View the docs or contact our support team and we'll get back to you as soon as we're able to respond.