mirror of
https://github.com/Kong/insomnia.git
synced 2026-04-22 15:18:27 -04:00
14 lines
411 B
Ruby
Executable File
14 lines
411 B
Ruby
Executable File
require 'uri'
|
|
require 'net/http'
|
|
|
|
url = URI("http://mockbin.com/har")
|
|
|
|
http = Net::HTTP.new(url.host, url.port)
|
|
|
|
request = Net::HTTP::Post.new(url)
|
|
request["content-type"] = 'application/json'
|
|
request.body = "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":{}}],\"boolean\":false}"
|
|
|
|
response = http.request(request)
|
|
puts response.read_body
|