From a88db74c19689a13e3dd8c8e317a2100a6009654 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 10 Apr 2017 00:03:17 +0900 Subject: [PATCH] Suppress `warning: URI.escape is obsolete` --- lib/yajl/http_stream.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/yajl/http_stream.rb b/lib/yajl/http_stream.rb index ff94b4af..d91c427a 100644 --- a/lib/yajl/http_stream.rb +++ b/lib/yajl/http_stream.rb @@ -101,7 +101,7 @@ def self.request(method, uri, opts = {}, &block) default_headers["Content-Type"] = opts["Content-Type"] || "application/x-www-form-urlencoded" body = opts.delete(:body) if body.is_a?(Hash) - body = body.keys.collect {|param| "#{URI.escape(param.to_s)}=#{URI.escape(body[param].to_s)}"}.join('&') + body = body.keys.collect {|param| "#{CGI.escape(param.to_s)}=#{CGI.escape(body[param].to_s)}"}.join('&') end default_headers["Content-Length"] = body.length end