Permalink
Browse files

reimplemented determine_content_type

  • Loading branch information...
1 parent c51da18 commit 8a0733c6344e73c130643cb52456b022462318f3 @hukl committed Aug 14, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/rig/http.rb
View
@@ -109,7 +109,15 @@ def prepare_header
end
def determine_content_type
- "text/plain"
+ if multipart?
+ "multipart/form-data; boundary=#{boundary}"
+ else
+ if %w(POST PUT).include?( http_method )
+ "application/x-www-form-urlencoded; charset=UTF-8"
+ else
+ "text/plain"
+ end
+ end
end
def normalize_options options

0 comments on commit 8a0733c

Please sign in to comment.