Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow override Urlencoded encoder implementation
``` ruby HTTP::FormData::Urlencoded.encoder = lambda do |enum| unescaped_chars = /[^a-z0-9\-\.\_\~]/i parts = [] enum.each do |k, v| k = ::URI::DEFAULT_PARSER.escape(k.to_s, unescaped_chars) if v.nil? parts << k elsif v.respond_to?(:to_ary) v.to_ary.each do |vv| vv = ::URI::DEFAULT_PARSER.escape(v.to_s, unescaped_chars) parts << "#{k}=#{vv}" end else v = ::URI::DEFAULT_PARSER.escape(v.to_s, unescaped_chars) parts << "#{k}=#{v}" end end parts.join("&") end ```
- Loading branch information