simple fork
replace self by other URI
object
v
String
public setter for the password
component. (with validation)
see also URI::Generic.check_password
require 'uri' uri = URI.parse("http://john:S3nsit1ve@my.example.com") uri.password = "V3ry_S3nsit1ve" # => "V3ry_S3nsit1ve" uri #=> #<URI::HTTP:0x00000000881d90 URL:http://john:V3ry_S3nsit1ve@my.example.com>
returns the password component
v
String
public setter for the host component v
. (with validation)
see also URI::Generic.check_host
require 'uri' uri = URI.parse("http://my.example.com") uri.host = "foo.com" # => "foo.com" uri #=> #<URI::HTTP:0x000000008e89e8 URL:http://foo.com>
extract the host part of the URI
and unwrap brackets for IPv6 addresses.
This method is same as URI::Generic#host
except brackets for IPv6 (and future IP) addresses are removed.
u = URI(“http://[::1]/bar”) p u.hostname #=> “::1” p u.host #=> “[::1]”
set the host part of the URI
as the argument with brackets for IPv6 addresses.
This method is same as URI::Generic#host=
except the argument can be bare IPv6 address.
u = URI(“foo/bar”) p u.to_s #=> “foo/bar” u.hostname = “::1” p u.to_s #=> “[::1]/bar”
If the argument seems IPv6 address, it is wrapped by brackets.
v
String
public setter for the port component v
. (with validation)
see also URI::Generic.check_port
require 'uri' uri = URI.parse("http://my.example.com") uri.port = 8080 # => 8080 uri #=> #<URI::HTTP:0x000000008e89e8 URL:http://my.example.com:8080>
Checks if URI
is relative
Returns normalized URI
Destructive version of normalize
Constructs String from URI
setter for to v
Constructs String from URI
Starts the CGI
process with the given environment env
and standard input and output stdin
and stdout
.
Sets the cookie expiration to the time t
. The expiration time may be a false value to disable expiration or a Time
or HTTP format time string to set the expiration date.
Retrieves the expiration time as a Time
The cookie string suitable for use in an HTTP header
The host this request is for
The port this request is for
Sets the response’s status to the status
code
The HTTP version as show in the HTTP request and response. For example, “1.1”