A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.rubydoc.info/github/rubygems/rubygems/Gem/URI below:

URI – Documentation for rubygems/rubygems (master) – RubyDoc.info

Returns a URL-encoded string derived from the given Enumerable enum.

The result is suitable for use as form data for an HTTP request whose Content-Type is 'application/x-www-form-urlencoded'.

The returned string consists of the elements of enum, each converted to one or more URL-encoded strings, and all joined with character '&'.

Simple examples:

Gem::URI.encode_www_form([['foo', 0], ['bar', 1], ['baz', 2]])
Gem::URI.encode_www_form({foo: 0, bar: 1, baz: 2})

The returned string is formed using method Gem::URI.encode_www_form_component, which converts certain characters:

Gem::URI.encode_www_form('f#o': '/', 'b-r': '$', 'b z': '@')

When enum is Array-like, each element ele is converted to a field:

The elements of an Array-like enum may be mixture:

Gem::URI.encode_www_form([['foo', 0], ['bar', 1, 2], ['baz'], :bat])

When enum is Hash-like, each key/value pair is converted to one or more fields:

The elements of a Hash-like enum may be mixture:

Gem::URI.encode_www_form({foo: [0, 1], bar: 2})

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4