Method: RestClient::Utils.escape

Defined in:
lib/restclient/utils.rb

.escape(string) ⇒ Object

Encode string for safe transport by URI or form encoding. This uses a CGI style escape, which transforms ‘ ` into `+` and various special characters into percent encoded forms.

This calls URI.encode_www_form_component for the implementation. The only difference between this and CGI.escape is that it does not escape ‘*`. stackoverflow.com/questions/25085992/

See Also:

  • URI.encode_www_form_component


270
271
272
# File 'lib/restclient/utils.rb', line 270

def self.escape(string)
  URI.encode_www_form_component(string)
end