class

URI::Params::Builder

Inherits Reference / Object

URI params builder.

Every parameter added is directly written to an IO, where keys and values are properly escaped.

Constructors

new(io : IO, *, space_to_plus : Bool = true)

Initializes this builder to write to the given io. space_to_plus controls how spaces are encoded:

  • if true (the default) they are converted to +
  • if false they are converted to %20
Source

Instance methods

add(key, value : String | Nil)

Adds a key-value pair to the params being built.

Source
add(key, values : Array)

Adds all of the given values as key-value pairs to the params being built.

Source