The format. helper in Rails calls .to_json on the object in the body. When using the head helper, it calls to_json on nil, resulting in "null". Since its a null value, it isn't necessarilly incorrect, but its debatable whether a HEAD only response should have a body at all. On the other hand. MultiJSON doesn't parse "null", " ", nil or an empty string. Of course we can also blame Net::HTTP for saying that null in the body stands for a string with "null". Thats like having a barbeque, forgetting the meat, but putting some lard on anyway. So, lets just let HTTParty fix it. Everyone's invited :-)
…ating the body See https://github.com/ruby/ruby/blob/v1_9_2_290/lib/net/http.rb#L878-904 for another example of this
This fixes issue #103.