Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save slopeofhope81/d379545966c008db776e1be2f38370da to your computer and use it in GitHub Desktop.
Save slopeofhope81/d379545966c008db776e1be2f38370da to your computer and use it in GitHub Desktop.
simple request
require 'json'
require 'net/http'
require 'byebug'
uri = URI('https://enzdvyp4.x.pipedream.net/first_name=Bryan&last_name=Helmig&age=27')
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
req.body = { "name": "Luke Skywalker" }.to_json
puts req.body
Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') do |http|
resp = http.request(req)
puts resp
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment