Skip to content

Instantly share code, notes, and snippets.

@abhiyerra
Created July 12, 2009 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhiyerra/145508 to your computer and use it in GitHub Desktop.
Save abhiyerra/145508 to your computer and use it in GitHub Desktop.
def post_multipart url, params
req = params.collect do |k,v|
"-F #{k}=#{v.kind_of?(File) ? '@' : ''}'#{v.kind_of?(File) ? v.path : v}'"
end.join(' ')
`curl -s #{req} #{url}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment