Skip to content

Instantly share code, notes, and snippets.

@lambdacpp
Created March 24, 2015 08:07
Show Gist options
  • Select an option

  • Save lambdacpp/fc9118e732ea45fbb76c to your computer and use it in GitHub Desktop.

Select an option

Save lambdacpp/fc9118e732ea45fbb76c to your computer and use it in GitHub Desktop.
markdown_string = 'Markdown *String* '
uri = URI('https://api.github.com/markdown/raw')
https = Net::HTTP.new(uri.host,uri.port)
https.use_ssl = true
req = Net::HTTP::Post.new(uri.path, initheader = {'Content-Type' =>'text/plain'})
req.body = markdown_string
res = https.request(req)
puts "Response #{res.code} #{res.message}: #{res.body}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment