W3cubDocs

/Crystal 0.31

class HTTP::Params::Builder

Overview

HTTP params builder.

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

Defined in:

http/params.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(io = IO::Memory.new)Source

Instance Method Detail

def add(key, value : String?)Source

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

def add(key, values : Array)Source

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

def to_s(io : IO) : NilSource

Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

© 2012–2019 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.31.1/HTTP/Params/Builder.html