Results for: "strip"

Error raised by the DRbProtocol module when it cannot find any protocol implementation support the scheme specified in a URI.

Timer id conversion keeps objects alive for a certain amount of time after their last access. The default time period is 600 seconds and can be changed upon initialization.

To use TimerIdConv:

DRb.install_id_conv TimerIdConv.new 60 # one minute

This class is the base class for Net::HTTP request classes. The class should not be used directly; instead you should use its subclasses, listed below.

Creating a Request

An request object may be created with either a URI or a string hostname:

require 'net/http'
uri = URI('https://jsonplaceholder.typicode.com/')
req = Net::HTTP::Get.new(uri)          # => #<Net::HTTP::Get GET>
req = Net::HTTP::Get.new(uri.hostname) # => #<Net::HTTP::Get GET>

And with any of the subclasses:

req = Net::HTTP::Head.new(uri) # => #<Net::HTTP::Head HEAD>
req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST>
req = Net::HTTP::Put.new(uri)  # => #<Net::HTTP::Put PUT>
# ...

The new instance is suitable for use as the argument to Net::HTTP#request.

Request Headers

A new request object has these header fields by default:

req.to_hash
# =>
{"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
"accept"=>["*/*"],
"user-agent"=>["Ruby"],
"host"=>["jsonplaceholder.typicode.com"]}

See:

You can add headers or override default headers:

#   res = Net::HTTP::Get.new(uri, {'foo' => '0', 'bar' => '1'})

This class (and therefore its subclasses) also includes (indirectly) module Net::HTTPHeader, which gives access to its methods for setting headers.

Request Subclasses

Subclasses for HTTP requests:

Subclasses for WebDAV requests:

Response class for Non-Authoritative Information responses (status code 203).

The Non-Authoritative Information response indicates that the server is a transforming proxy (such as a Web accelerator) that received a 200 OK response from its origin, and is returning a modified version of the origin’s response.

References:

Response class for Multi-Status (WebDAV) responses (status code 207).

The Multi-Status (WebDAV) response indicates that the server has received the request, and that the message body can contain a number of separate response codes.

References:

Response class for Multiple Choices responses (status code 300).

The Multiple Choices response indicates that the server offers multiple options for the resource from which the client may choose.

References:

Response class for Multiple Choices responses (status code 300).

The Multiple Choices response indicates that the server offers multiple options for the resource from which the client may choose.

References:

Response class for Found responses (status code 302).

The Found response indicates that the client should look at (browse to) another URL.

References:

Response class for Permanent Redirect responses (status code 308).

This and all future requests should be directed to the given URI.

References:

Response class for Bad Request responses (status code 400).

The server cannot or will not process the request due to an apparent client error.

References:

Response class for Unauthorized responses (status code 401).

Authentication is required, but either was not provided or failed.

References:

Response class for Payment Required responses (status code 402).

Reserved for future use.

References:

Response class for Request Timeout responses (status code 408).

The server timed out waiting for the request.

References:

Response class for Request Timeout responses (status code 408).

The server timed out waiting for the request.

References:

Response class for Payload Too Large responses (status code 413).

The request is larger than the server is willing or able to process.

References:

Response class for URI Too Long responses (status code 414).

The URI provided was too long for the server to process.

References:

Response class for Range Not Satisfiable responses (status code 416).

The request entity has a media type which the server or resource does not support.

References:

Response class for Misdirected Request responses (status code 421).

The request was directed at a server that is not able to produce a response.

References:

Response class for Too Many Requests responses (status code 429).

The user has sent too many requests in a given amount of time.

References:

Response class for Variant Also Negotiates responses (status code 506).

Transparent content negotiation for the request results in a circular reference.

References:

Response class for Insufficient Storage (WebDAV) responses (status code 507).

The server is unable to store the representation needed to complete the request.

References:

No documentation available

WriteTimeout, a subclass of Timeout::Error, is raised if a chunk of the response cannot be written within the write_timeout. Not raised on Windows.

The writer adapter class

Simple option list providing mapping from short and/or long option string to OptionParser::Switch and mapping from acceptable argument to matching pattern and converter pair. Also provides summary feature.

Search took: 3ms  ·  Total Results: 2190