Skip to content

Instantly share code, notes, and snippets.

@MelloHey
Created December 14, 2018 10:49
Show Gist options
  • Save MelloHey/e18dfa14021774665922cf7a73169a39 to your computer and use it in GitHub Desktop.
Save MelloHey/e18dfa14021774665922cf7a73169a39 to your computer and use it in GitHub Desktop.
curl to ruby
curl -X POST https://mydomain.com/attachments -H 'authorization: Got this’ -F "readme=@README.md"
----------------------------------------------------------------------------------------------------------------
uri = URI.parse("https://mydomain.com/attachments")
request = Net::HTTP::Post.new(uri)
req_headers
request["Authorization"] = req_headers
req_options = {
use_ssl: uri.scheme == "https",
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
byebug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment