How to do url encode of json in ruby How to do url encode of json in ruby json json

How to do url encode of json in ruby


Use URI.escape

require 'uri'enc_uri = URI.escape("http://example.com/?a=\11\15")p enc_uri# => "http://example.com/?a=%09%0D"


require 'uri'enc_uri = URI.encode_base64("http://example.com/?a=\11\15")p enc_uri