Results for: "Data"

Set path for which this cookie applies

Matches addr against this entry.

Matches addr against each ACLEntry in this list.

Creates a new Net::HTTP object, http, via Net::HTTP.new:

With no block given:

With a block given:

Example:

hostname = 'jsonplaceholder.typicode.com'
Net::HTTP.start(hostname) do |http|
  puts http.get('/todos/1').body
  puts http.get('/todos/2').body
end

Output:

{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}
{
  "userId": 1,
  "id": 2,
  "title": "quis ut nam facilis et officia qui",
  "completed": false
}

If the last argument given is a hash, it is the opts hash, where each key is a method or accessor to be called, and its value is the value to be set.

The keys may include:

Note: If port is nil and opts[:use_ssl] is a truthy value, the value passed to new is Net::HTTP.https_default_port, not port.

Returns true if the HTTP session has been started:

http = Net::HTTP.new(hostname)
http.started? # => false
http.start
http.started? # => true
http.finish # => nil
http.started? # => false

Net::HTTP.start(hostname) do |http|
  http.started?
end # => true
http.started? # => false

Starts an HTTP session.

Without a block, returns self:

http = Net::HTTP.new(hostname)
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
http.start
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=true>
http.started? # => true
http.finish

With a block, calls the block with self, finishes the session when the block exits, and returns the block’s value:

http.start do |http|
  http
end
# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
http.started? # => false

Sends a PATCH request to the server; returns an instance of a subclass of Net::HTTPResponse.

The request is based on the Net::HTTP::Patch object created from string path, string data, and initial headers hash initheader.

With a block given, calls the block with the response body:

data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
http = Net::HTTP.new(hostname)
http.patch('/todos/1', data) do |res|
  p res
end # => #<Net::HTTPOK 200 OK readbody=true>

Output:

"{\n  \"userId\": 1,\n  \"id\": 1,\n  \"title\": \"delectus aut autem\",\n  \"completed\": false,\n  \"{\\\"userId\\\": 1, \\\"id\\\": 1, \\\"title\\\": \\\"delectus aut autem\\\", \\\"completed\\\": false}\": \"\"\n}"

With no block given, simply returns the response object:

http.patch('/todos/1', data) # => #<Net::HTTPCreated 201 Created readbody=true>

Sends a PROPPATCH request to the server; returns an instance of a subclass of Net::HTTPResponse.

The request is based on the Net::HTTP::Proppatch object created from string path, string body, and initial headers hash initheader.

data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
http = Net::HTTP.new(hostname)
http.proppatch('/todos/1', data)

Returns the path from an FTP URI.

RFC 1738 specifically states that the path for an FTP URI does not include the / which separates the URI path from the URI host. Example:

ftp://ftp.example.com/pub/ruby

The above URI indicates that the client should connect to ftp.example.com then cd to pub/ruby from the initial login directory.

If you want to cd to an absolute directory, you must include an escaped / (%2F) in the path. Example:

ftp://ftp.example.com/%2Fpub/ruby

This method will then return “/pub/ruby”.

No documentation available

Completion for hash key.

def operator: () -> String

def operator: () -> String

def operator: () -> String?

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String

def operator: () -> String?

def operator: () -> String

def operator: () -> String

Search took: 4ms  ·  Total Results: 1843