Skip to content

Instantly share code, notes, and snippets.

@kimat
kimat / requesttest.rb
Created June 16, 2023 13:47 — forked from justinwoo/requesttest.rb
simple HTTP request testing using net/http and a JSON POST payload | Update: I guess I might start updating this again. I am pretty fickle.
#! usr/bin/ruby
require 'uri'
require 'net/http'
require 'json'
def getRequest(url)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
request["Accept"] = "application/json"