Skip to content

Instantly share code, notes, and snippets.

@ayosec
Created November 27, 2012 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayosec/4154346 to your computer and use it in GitHub Desktop.
Save ayosec/4154346 to your computer and use it in GitHub Desktop.
Client for the GitHub Markdown API
require "json"
require "net/https"
content = ARGF.read
http = Net::HTTP.new("api.github.com", 443).tap do |h|
h.use_ssl = true
end
request = Net::HTTP::Post.new("/markdown")
request.body = {text: content, mode: "gfm"}.to_json
response = http.request(request)
print response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment