Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Created May 3, 2013 18:57
Show Gist options
  • Save avgerin0s/5512813 to your computer and use it in GitHub Desktop.
Save avgerin0s/5512813 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'net/https'
gist = {
"description" => "wat",
"public" => false,
"files" => {
"popme_backup" => {
"content" => "wat"
}
}
}
uri = URI.parse("https://api.github.com/gists")
https = Net::HTTP.new(uri.host,uri.port)
https.use_ssl = true
req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'application/json'})
req.body = "[ #{gist} ]"
res = https.request(req)
puts res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment