Skip to content

Instantly share code, notes, and snippets.

View HaChan's full-sized avatar

Ha Chan HaChan

  • Podfoods
  • Ha Noi, Viet Nam
View GitHub Profile
@HaChan
HaChan / multipart_post.rb
Created November 27, 2014 17:10
multipart post using ruby
require "net/http"
require "uri"
class MultipartPost
BOUNDARY = "-----------RubyMultipartPost"
EOL = "\r\n"
def initialize uri, &block
@params = Array.new
@uri = URI.parse uri
instance_eval &block if block