Browse files

control header function changed in order to crontrol by http scheme

  • Loading branch information...
1 parent 499ccf6 commit d4f88f612c0d61f179405a2b765a4f180d1d17bd @matsumoto-r committed Jan 1, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 mrblib/httprequest.rb
View
10 mrblib/httprequest.rb
@@ -49,11 +49,13 @@ def create_http_request(method, body, headers)
request = {}
request = headers
if method == "POST" || method == "PUT" || method == "GET"
- request["body"] = body.is_a?(Hash) ? encode_parameters(body) : body.to_s
- unless request["Content-Type"]
- request["Content-Type"] = 'application/x-www-form-urlencoded'
+ #if request["Content-Type"]
+ # request["Content-Type"] = 'application/x-www-form-urlencoded'
+ #end
+ if body
+ request["body"] = body.is_a?(Hash) ? encode_parameters(body) : body.to_s
+ request["Content-Length"] = (request["body"] || '').length
end
- request["Content-Length"] = (request["body"] || '').length
end
request
end

0 comments on commit d4f88f6

Please sign in to comment.