Skip to content

Instantly share code, notes, and snippets.

@aanand
Created December 10, 2008 17:25
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 aanand/34402 to your computer and use it in GitHub Desktop.
Save aanand/34402 to your computer and use it in GitHub Desktop.
def multipart_request url, env
m = Merb::Test::MultipartRequestHelper::Post.new(env.delete(:params))
body, head = m.to_multipart
mp_env = {
:method => 'POST',
'CONTENT_TYPE' => head,
'CONTENT_LENGTH' => body.length,
:input => body
}
request url, mp_env.merge(env)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment