rbs 4.0.0.dev.5 → 4.0.1.dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.clang-format +1 -0
- data/.github/workflows/c-check.yml +8 -4
- data/.github/workflows/comments.yml +3 -1
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +10 -0
- data/.github/workflows/rust.yml +95 -0
- data/CHANGELOG.md +323 -0
- data/Rakefile +12 -29
- data/Steepfile +1 -0
- data/config.yml +393 -37
- data/core/array.rbs +218 -188
- data/core/basic_object.rbs +9 -8
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +45 -31
- data/core/complex.rbs +52 -40
- data/core/dir.rbs +57 -45
- data/core/encoding.rbs +5 -5
- data/core/enumerable.rbs +96 -91
- data/core/enumerator.rbs +4 -3
- data/core/errno.rbs +3 -2
- data/core/errors.rbs +31 -29
- data/core/exception.rbs +12 -12
- data/core/fiber.rbs +36 -36
- data/core/file.rbs +186 -113
- data/core/file_test.rbs +2 -2
- data/core/float.rbs +41 -32
- data/core/gc.rbs +78 -70
- data/core/hash.rbs +70 -60
- data/core/integer.rbs +32 -28
- data/core/io/buffer.rbs +36 -36
- data/core/io/wait.rbs +7 -7
- data/core/io.rbs +120 -135
- data/core/kernel.rbs +189 -139
- data/core/marshal.rbs +3 -3
- data/core/match_data.rbs +14 -12
- data/core/math.rbs +69 -67
- data/core/method.rbs +6 -6
- data/core/module.rbs +146 -85
- data/core/nil_class.rbs +4 -3
- data/core/numeric.rbs +35 -32
- data/core/object.rbs +6 -8
- data/core/object_space.rbs +11 -10
- data/core/pathname.rbs +131 -81
- data/core/proc.rbs +65 -33
- data/core/process.rbs +219 -201
- data/core/ractor.rbs +15 -11
- data/core/random.rbs +4 -3
- data/core/range.rbs +52 -47
- data/core/rational.rbs +5 -5
- data/core/rbs/unnamed/argf.rbs +58 -51
- data/core/rbs/unnamed/env_class.rbs +18 -13
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +7 -5
- data/core/regexp.rbs +236 -197
- data/core/ruby.rbs +1 -1
- data/core/ruby_vm.rbs +32 -30
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +1 -1
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +5 -3
- data/core/set.rbs +17 -16
- data/core/signal.rbs +2 -2
- data/core/string.rbs +311 -292
- data/core/struct.rbs +26 -25
- data/core/symbol.rbs +25 -24
- data/core/thread.rbs +40 -34
- data/core/time.rbs +47 -42
- data/core/trace_point.rbs +34 -31
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +10 -10
- data/core/warning.rbs +7 -7
- data/docs/collection.md +1 -1
- data/docs/config.md +171 -0
- data/docs/inline.md +110 -4
- data/docs/syntax.md +13 -12
- data/ext/rbs_extension/ast_translation.c +489 -135
- data/ext/rbs_extension/class_constants.c +8 -0
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/legacy_location.c +28 -51
- data/ext/rbs_extension/legacy_location.h +37 -0
- data/ext/rbs_extension/main.c +12 -20
- data/include/rbs/ast.h +423 -195
- data/include/rbs/lexer.h +2 -2
- data/include/rbs/location.h +25 -44
- data/include/rbs/parser.h +2 -2
- data/include/rbs/util/rbs_constant_pool.h +0 -3
- data/include/rbs.h +8 -0
- data/lib/rbs/ast/ruby/annotations.rb +157 -4
- data/lib/rbs/ast/ruby/members.rb +374 -22
- data/lib/rbs/cli/validate.rb +5 -60
- data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
- data/lib/rbs/definition_builder.rb +60 -27
- data/lib/rbs/errors.rb +0 -11
- data/lib/rbs/inline_parser.rb +1 -1
- data/lib/rbs/parser_aux.rb +20 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +1 -26
- data/lib/rbs/prototype/rbi.rb +1 -20
- data/lib/rbs/test/type_check.rb +3 -0
- data/lib/rbs/types.rb +62 -52
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +0 -1
- data/rbs.gemspec +1 -1
- data/rust/.gitignore +1 -0
- data/rust/Cargo.lock +378 -0
- data/rust/Cargo.toml +7 -0
- data/rust/ruby-rbs/Cargo.toml +22 -0
- data/rust/ruby-rbs/build.rs +764 -0
- data/rust/ruby-rbs/examples/locations.rs +60 -0
- data/rust/ruby-rbs/src/lib.rs +1 -0
- data/rust/ruby-rbs/src/node/mod.rs +742 -0
- data/rust/ruby-rbs/tests/sanity.rs +47 -0
- data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
- data/rust/ruby-rbs-sys/Cargo.toml +23 -0
- data/rust/ruby-rbs-sys/build.rs +204 -0
- data/rust/ruby-rbs-sys/src/lib.rs +50 -0
- data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
- data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
- data/rust/ruby-rbs-sys/wrapper.h +1 -0
- data/sig/ast/ruby/annotations.rbs +191 -4
- data/sig/ast/ruby/members.rbs +21 -1
- data/sig/cli/validate.rbs +1 -6
- data/sig/definition_builder.rbs +2 -0
- data/sig/errors.rbs +0 -8
- data/sig/method_types.rbs +1 -1
- data/sig/parser.rbs +17 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/types.rbs +10 -11
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +339 -161
- data/src/lexstate.c +1 -1
- data/src/location.c +7 -47
- data/src/parser.c +674 -480
- data/src/util/rbs_constant_pool.c +0 -4
- data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
- data/stdlib/cgi-escape/0/escape.rbs +4 -4
- data/stdlib/coverage/0/coverage.rbs +4 -3
- data/stdlib/date/0/date.rbs +33 -28
- data/stdlib/date/0/date_time.rbs +24 -23
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/erb/0/erb.rbs +64 -53
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +138 -125
- data/stdlib/forwardable/0/forwardable.rbs +10 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +135 -108
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +159 -134
- data/stdlib/objspace/0/objspace.rbs +8 -7
- data/stdlib/open-uri/0/open-uri.rbs +8 -8
- data/stdlib/open3/0/open3.rbs +36 -35
- data/stdlib/openssl/0/openssl.rbs +144 -129
- data/stdlib/optparse/0/optparse.rbs +18 -14
- data/stdlib/pathname/0/pathname.rbs +2 -2
- data/stdlib/pp/0/pp.rbs +9 -8
- data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
- data/stdlib/pstore/0/pstore.rbs +35 -30
- data/stdlib/psych/0/psych.rbs +61 -8
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
- data/stdlib/ripper/0/ripper.rbs +20 -17
- data/stdlib/securerandom/0/securerandom.rbs +1 -1
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- data/stdlib/socket/0/addrinfo.rbs +7 -7
- data/stdlib/socket/0/basic_socket.rbs +3 -3
- data/stdlib/socket/0/ip_socket.rbs +10 -8
- data/stdlib/socket/0/socket.rbs +10 -9
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +1 -1
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +55 -54
- data/stdlib/strscan/0/string_scanner.rbs +46 -44
- data/stdlib/tempfile/0/tempfile.rbs +24 -20
- data/stdlib/time/0/time.rbs +7 -5
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +26 -18
- data/stdlib/uri/0/file.rbs +2 -2
- data/stdlib/uri/0/generic.rbs +2 -2
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/ldap.rbs +2 -2
- data/stdlib/uri/0/mailto.rbs +3 -3
- data/stdlib/uri/0/rfc2396_parser.rbs +6 -5
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +4 -4
- data/stdlib/zlib/0/gzip_writer.rbs +14 -12
- data/stdlib/zlib/0/inflate.rbs +1 -1
- data/stdlib/zlib/0/need_dict.rbs +1 -1
- metadata +23 -5
- data/.github/workflows/valgrind.yml +0 -42
|
@@ -20,8 +20,8 @@ module Net
|
|
|
20
20
|
#
|
|
21
21
|
# ## About the Examples
|
|
22
22
|
#
|
|
23
|
-
# Examples here assume that
|
|
24
|
-
# `uri`):
|
|
23
|
+
# Examples here assume that <code>net/http</code> has been required (which also
|
|
24
|
+
# requires `uri`):
|
|
25
25
|
#
|
|
26
26
|
# require 'net/http'
|
|
27
27
|
#
|
|
@@ -129,7 +129,8 @@ module Net
|
|
|
129
129
|
# An internet URI has a
|
|
130
130
|
# [scheme](https://en.wikipedia.org/wiki/List_of_URI_schemes).
|
|
131
131
|
#
|
|
132
|
-
# The two schemes supported in Net::HTTP are
|
|
132
|
+
# The two schemes supported in Net::HTTP are <code>'https'</code> and
|
|
133
|
+
# <code>'http'</code>:
|
|
133
134
|
#
|
|
134
135
|
# uri.scheme # => "https"
|
|
135
136
|
# URI('http://example.com').scheme # => "http"
|
|
@@ -358,7 +359,7 @@ module Net
|
|
|
358
359
|
# or method Net::HTTP.start.
|
|
359
360
|
#
|
|
360
361
|
# The proxy may be defined either by argument `p_addr` or by environment
|
|
361
|
-
# variable
|
|
362
|
+
# variable <code>'http_proxy'</code>.
|
|
362
363
|
#
|
|
363
364
|
# ### Proxy Using Argument `p_addr` as a String
|
|
364
365
|
#
|
|
@@ -385,11 +386,12 @@ module Net
|
|
|
385
386
|
# http.proxy_user # => "pname"
|
|
386
387
|
# http.proxy_pass # => "ppass"
|
|
387
388
|
#
|
|
388
|
-
# ### Proxy Using '
|
|
389
|
+
# ### Proxy Using '<code>ENV['http_proxy']</code>'
|
|
389
390
|
#
|
|
390
|
-
# When environment variable
|
|
391
|
-
# `http` will have the server at that URI as its proxy; note that
|
|
392
|
-
# must have a protocol such as
|
|
391
|
+
# When environment variable <code>'http_proxy'</code> is set to a URI string,
|
|
392
|
+
# the returned `http` will have the server at that URI as its proxy; note that
|
|
393
|
+
# the URI string must have a protocol such as <code>'http'</code> or
|
|
394
|
+
# <code>'https'</code>:
|
|
393
395
|
#
|
|
394
396
|
# ENV['http_proxy'] = 'http://example.com'
|
|
395
397
|
# http = Net::HTTP.new(hostname)
|
|
@@ -447,8 +449,8 @@ module Net
|
|
|
447
449
|
#
|
|
448
450
|
# Net::HTTP does not compress the body of a request before sending.
|
|
449
451
|
#
|
|
450
|
-
# By default, Net::HTTP adds header
|
|
451
|
-
# object](rdoc-ref:Net::HTTPRequest):
|
|
452
|
+
# By default, Net::HTTP adds header <code>'Accept-Encoding'</code> to a new
|
|
453
|
+
# [request object](rdoc-ref:Net::HTTPRequest):
|
|
452
454
|
#
|
|
453
455
|
# Net::HTTP::Get.new(uri)['Accept-Encoding']
|
|
454
456
|
# # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
|
@@ -457,16 +459,16 @@ module Net
|
|
|
457
459
|
# server is not required to do so.
|
|
458
460
|
#
|
|
459
461
|
# Net::HTTP does not automatically decompress a response body if the response
|
|
460
|
-
# has header
|
|
462
|
+
# has header <code>'Content-Range'</code>.
|
|
461
463
|
#
|
|
462
464
|
# Otherwise decompression (or not) depends on the value of header
|
|
463
465
|
# [Content-Encoding](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#co
|
|
464
466
|
# ntent-encoding-response-header):
|
|
465
467
|
#
|
|
466
|
-
# *
|
|
467
|
-
# the header.
|
|
468
|
-
# *
|
|
469
|
-
# header.
|
|
468
|
+
# * <code>'deflate'</code>, <code>'gzip'</code>, or <code>'x-gzip'</code>:
|
|
469
|
+
# decompresses the body and deletes the header.
|
|
470
|
+
# * <code>'none'</code> or <code>'identity'</code>: does not decompress the
|
|
471
|
+
# body, but deletes the header.
|
|
470
472
|
# * Any other value: leaves the body and header unchanged.
|
|
471
473
|
#
|
|
472
474
|
# ## What's Here
|
|
@@ -584,9 +586,11 @@ module Net
|
|
|
584
586
|
# * [:close_on_empty_response=](rdoc-ref:Net::HTTP#close_on_empty_response=):
|
|
585
587
|
# Sets whether to close connection on empty response.
|
|
586
588
|
# * [:ignore_eof](rdoc-ref:Net::HTTP#ignore_eof): Returns whether to ignore
|
|
587
|
-
# end-of-file when reading a response body with
|
|
589
|
+
# end-of-file when reading a response body with <code>Content-Length</code>
|
|
590
|
+
# headers.
|
|
588
591
|
# * [:ignore_eof=](rdoc-ref:Net::HTTP#ignore_eof=): Sets whether to ignore
|
|
589
|
-
# end-of-file when reading a response body with
|
|
592
|
+
# end-of-file when reading a response body with <code>Content-Length</code>
|
|
593
|
+
# headers.
|
|
590
594
|
# * [:response_body_encoding](rdoc-ref:Net::HTTP#response_body_encoding):
|
|
591
595
|
# Returns the encoding to use for the response body.
|
|
592
596
|
# * [#response_body_encoding=](rdoc-ref:Net::HTTP#response_body_encoding=):
|
|
@@ -907,8 +911,8 @@ module Net
|
|
|
907
911
|
#
|
|
908
912
|
# With no block given:
|
|
909
913
|
#
|
|
910
|
-
# * Calls
|
|
911
|
-
# connection and HTTP session.
|
|
914
|
+
# * Calls <code>http.start</code> with no block (see #start), which opens a
|
|
915
|
+
# TCP connection and HTTP session.
|
|
912
916
|
# * Returns `http`.
|
|
913
917
|
# * The caller should call #finish to close the session:
|
|
914
918
|
#
|
|
@@ -919,7 +923,7 @@ module Net
|
|
|
919
923
|
#
|
|
920
924
|
# With a block given:
|
|
921
925
|
#
|
|
922
|
-
# * Calls
|
|
926
|
+
# * Calls <code>http.start</code> with the block (see #start), which:
|
|
923
927
|
#
|
|
924
928
|
# * Opens a TCP connection and HTTP session.
|
|
925
929
|
# * Calls the block, which may make any number of requests to the host.
|
|
@@ -975,8 +979,8 @@ module Net
|
|
|
975
979
|
# * #verify_mode
|
|
976
980
|
# * #write_timeout
|
|
977
981
|
#
|
|
978
|
-
# Note: If `port` is `nil` and
|
|
979
|
-
# passed to `new` is Net::HTTP.https_default_port, not `port`.
|
|
982
|
+
# Note: If `port` is `nil` and <code>opts[:use_ssl]</code> is a truthy value,
|
|
983
|
+
# the value passed to `new` is Net::HTTP.https_default_port, not `port`.
|
|
980
984
|
#
|
|
981
985
|
def self.start: (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped]?, **untyped opt) -> Net::HTTP
|
|
982
986
|
| [T] (String address, ?Integer? port, ?String | :ENV | nil p_addr, ?Integer? p_port, ?String? p_user, ?String? p_pass, ?Hash[Symbol, untyped]?, **untyped opt) { (Net::HTTP) -> T } -> T
|
|
@@ -995,8 +999,8 @@ module Net
|
|
|
995
999
|
# Returns a new Net::HTTP object `http` (but does not open a TCP connection or
|
|
996
1000
|
# HTTP session).
|
|
997
1001
|
#
|
|
998
|
-
# With only string argument `address` given (and
|
|
999
|
-
# or `nil`), the returned `http`:
|
|
1002
|
+
# With only string argument `address` given (and <code>ENV['http_proxy']</code>
|
|
1003
|
+
# undefined or `nil`), the returned `http`:
|
|
1000
1004
|
#
|
|
1001
1005
|
# * Has the given address.
|
|
1002
1006
|
# * Has the default port number, Net::HTTP.default_port (80).
|
|
@@ -1112,9 +1116,8 @@ module Net
|
|
|
1112
1116
|
|
|
1113
1117
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1114
1118
|
# Sets whether to determine the proxy from environment variable
|
|
1115
|
-
# '
|
|
1116
|
-
# ENV
|
|
1117
|
-
# -27).
|
|
1119
|
+
# '<code>ENV['http_proxy']</code>'; see {Proxy Using
|
|
1120
|
+
# [ENV]('http_proxy')}[Net::HTTP@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27].
|
|
1118
1121
|
#
|
|
1119
1122
|
attr_writer proxy_from_env: untyped
|
|
1120
1123
|
|
|
@@ -1354,15 +1357,15 @@ module Net
|
|
|
1354
1357
|
|
|
1355
1358
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1356
1359
|
# Sets or returns the available SSL ciphers. See
|
|
1357
|
-
# [
|
|
1360
|
+
# [OpenSSL::SSL::SSLContext#ciphers=](OpenSSL::SSL::SSL::Context#ciphers=).
|
|
1358
1361
|
#
|
|
1359
1362
|
attr_accessor ciphers: untyped
|
|
1360
1363
|
|
|
1361
1364
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1362
1365
|
# Sets or returns the extra X509 certificates to be added to the certificate
|
|
1363
1366
|
# chain. See
|
|
1364
|
-
# [
|
|
1365
|
-
# .
|
|
1367
|
+
# [OpenSSL::SSL::SSLContext#add_certificate](OpenSSL::SSL::SSL::Context#add_cert
|
|
1368
|
+
# ificate).
|
|
1366
1369
|
#
|
|
1367
1370
|
attr_accessor extra_chain_cert: untyped
|
|
1368
1371
|
|
|
@@ -1378,19 +1381,22 @@ module Net
|
|
|
1378
1381
|
|
|
1379
1382
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1380
1383
|
# Sets or returns the SSL version. See
|
|
1381
|
-
# [
|
|
1384
|
+
# [OpenSSL::SSL::SSLContext#ssl_version=](OpenSSL::SSL::SSL::Context#ssl_version
|
|
1385
|
+
# =).
|
|
1382
1386
|
#
|
|
1383
1387
|
attr_accessor ssl_version: untyped
|
|
1384
1388
|
|
|
1385
1389
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1386
1390
|
# Sets or returns the minimum SSL version. See
|
|
1387
|
-
# [
|
|
1391
|
+
# [OpenSSL::SSL::SSLContext#min_version=](OpenSSL::SSL::SSL::Context#min_version
|
|
1392
|
+
# =).
|
|
1388
1393
|
#
|
|
1389
1394
|
attr_accessor min_version: untyped
|
|
1390
1395
|
|
|
1391
1396
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1392
1397
|
# Sets or returns the maximum SSL version. See
|
|
1393
|
-
# [
|
|
1398
|
+
# [OpenSSL::SSL::SSLContext#max_version=](OpenSSL::SSL::SSL::Context#max_version
|
|
1399
|
+
# =).
|
|
1394
1400
|
#
|
|
1395
1401
|
attr_accessor max_version: untyped
|
|
1396
1402
|
|
|
@@ -1414,8 +1420,8 @@ module Net
|
|
|
1414
1420
|
# <!-- rdoc-file=lib/net/http.rb -->
|
|
1415
1421
|
# Sets or returns whether to verify that the server certificate is valid for the
|
|
1416
1422
|
# hostname. See
|
|
1417
|
-
# [
|
|
1418
|
-
# =).
|
|
1423
|
+
# [OpenSSL::SSL::SSLContext#verify_hostname=](OpenSSL::SSL::SSL::Context#verify_
|
|
1424
|
+
# hostname=).
|
|
1419
1425
|
#
|
|
1420
1426
|
attr_accessor verify_hostname: untyped
|
|
1421
1427
|
|
|
@@ -2005,8 +2011,8 @@ module Net
|
|
|
2005
2011
|
#
|
|
2006
2012
|
# ## About the Examples
|
|
2007
2013
|
#
|
|
2008
|
-
# Examples here assume that
|
|
2009
|
-
# `uri`):
|
|
2014
|
+
# Examples here assume that <code>net/http</code> has been required (which also
|
|
2015
|
+
# requires `uri`):
|
|
2010
2016
|
#
|
|
2011
2017
|
# require 'net/http'
|
|
2012
2018
|
#
|
|
@@ -2074,9 +2080,9 @@ module Net
|
|
|
2074
2080
|
attr_reader uri: URI::Generic
|
|
2075
2081
|
|
|
2076
2082
|
# <!-- rdoc-file=lib/net/http/generic_request.rb -->
|
|
2077
|
-
# Returns `false` if the request's header
|
|
2078
|
-
# manually or deleted (indicating that the user intends to handle
|
|
2079
|
-
# the response), `true` otherwise:
|
|
2083
|
+
# Returns `false` if the request's header <code>'Accept-Encoding'</code> has
|
|
2084
|
+
# been set manually or deleted (indicating that the user intends to handle
|
|
2085
|
+
# encoding in the response), `true` otherwise:
|
|
2080
2086
|
#
|
|
2081
2087
|
# req = Net::HTTP::Get.new(uri) # => #<Net::HTTP::Get GET>
|
|
2082
2088
|
# req['Accept-Encoding'] # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
|
|
@@ -2207,8 +2213,8 @@ module Net
|
|
|
2207
2213
|
#
|
|
2208
2214
|
# ## About the Examples
|
|
2209
2215
|
#
|
|
2210
|
-
# Examples here assume that
|
|
2211
|
-
# `uri`):
|
|
2216
|
+
# Examples here assume that <code>net/http</code> has been required (which also
|
|
2217
|
+
# requires `uri`):
|
|
2212
2218
|
#
|
|
2213
2219
|
# require 'net/http'
|
|
2214
2220
|
#
|
|
@@ -2248,10 +2254,10 @@ module Net
|
|
|
2248
2254
|
#
|
|
2249
2255
|
# A field key may be:
|
|
2250
2256
|
#
|
|
2251
|
-
# * A string: Key
|
|
2252
|
-
# i.e.,
|
|
2253
|
-
# * A symbol: Key
|
|
2254
|
-
# i.e.,
|
|
2257
|
+
# * A string: Key <code>'Accept'</code> is treated as if it were
|
|
2258
|
+
# <code>'Accept'.downcase</code>; i.e., <code>'accept'</code>.
|
|
2259
|
+
# * A symbol: Key <code>:Accept</code> is treated as if it were
|
|
2260
|
+
# <code>:Accept.to_s.downcase</code>; i.e., <code>'accept'</code>.
|
|
2255
2261
|
#
|
|
2256
2262
|
# Examples:
|
|
2257
2263
|
#
|
|
@@ -2276,7 +2282,7 @@ module Net
|
|
|
2276
2282
|
# name; its value is the array value for the field.
|
|
2277
2283
|
#
|
|
2278
2284
|
# * These methods return field values as string; the string value for a field
|
|
2279
|
-
# is equivalent to
|
|
2285
|
+
# is equivalent to <code>self[key.downcase.to_s].join(', '))</code>:
|
|
2280
2286
|
#
|
|
2281
2287
|
# * #[]: Returns the string value for the given key, or `nil` if it does
|
|
2282
2288
|
# not exist.
|
|
@@ -2339,12 +2345,15 @@ module Net
|
|
|
2339
2345
|
#
|
|
2340
2346
|
# * #[]=: Sets the string or array value for the given key.
|
|
2341
2347
|
# * #add_field: Creates or adds to the array value for the given key.
|
|
2342
|
-
# * #basic_auth: Sets the string authorization header for
|
|
2343
|
-
#
|
|
2344
|
-
# * #
|
|
2348
|
+
# * #basic_auth: Sets the string authorization header for
|
|
2349
|
+
# <code>'Authorization'</code>.
|
|
2350
|
+
# * #content_length=: Sets the integer length for field
|
|
2351
|
+
# <code>'Content-Length</code>.
|
|
2352
|
+
# * #content_type=: Sets the string value for field
|
|
2353
|
+
# <code>'Content-Type'</code>.
|
|
2345
2354
|
# * #proxy_basic_auth: Sets the string authorization header for
|
|
2346
|
-
#
|
|
2347
|
-
# * #set_range: Sets the value for field
|
|
2355
|
+
# <code>'Proxy-Authorization'</code>.
|
|
2356
|
+
# * #set_range: Sets the value for field <code>'Range'</code>.
|
|
2348
2357
|
#
|
|
2349
2358
|
# ### Form Setters
|
|
2350
2359
|
#
|
|
@@ -2358,28 +2367,33 @@ module Net
|
|
|
2358
2367
|
# simple string value:
|
|
2359
2368
|
#
|
|
2360
2369
|
# * #[]: Returns the string field value for the given key.
|
|
2361
|
-
# * #content_length: Returns the integer value of field
|
|
2362
|
-
#
|
|
2363
|
-
# * #
|
|
2370
|
+
# * #content_length: Returns the integer value of field
|
|
2371
|
+
# <code>'Content-Length'</code>.
|
|
2372
|
+
# * #content_range: Returns the Range value of field
|
|
2373
|
+
# <code>'Content-Range'</code>.
|
|
2374
|
+
# * #content_type: Returns the string value of field
|
|
2375
|
+
# <code>'Content-Type'</code>.
|
|
2364
2376
|
# * #fetch: Returns the string field value for the given key.
|
|
2365
2377
|
# * #get_fields: Returns the array field value for the given `key`.
|
|
2366
2378
|
# * #main_type: Returns first part of the string value of field
|
|
2367
|
-
#
|
|
2379
|
+
# <code>'Content-Type'</code>.
|
|
2368
2380
|
# * #sub_type: Returns second part of the string value of field
|
|
2369
|
-
#
|
|
2370
|
-
# * #range: Returns an array of Range objects of field
|
|
2381
|
+
# <code>'Content-Type'</code>.
|
|
2382
|
+
# * #range: Returns an array of Range objects of field <code>'Range'</code>,
|
|
2383
|
+
# or `nil`.
|
|
2371
2384
|
# * #range_length: Returns the integer length of the range given in field
|
|
2372
|
-
#
|
|
2373
|
-
# * #type_params: Returns the string parameters for
|
|
2385
|
+
# <code>'Content-Range'</code>.
|
|
2386
|
+
# * #type_params: Returns the string parameters for
|
|
2387
|
+
# <code>'Content-Type'</code>.
|
|
2374
2388
|
#
|
|
2375
2389
|
# ### Queries
|
|
2376
2390
|
#
|
|
2377
|
-
# * #chunked?: Returns whether field
|
|
2378
|
-
#
|
|
2379
|
-
# * #connection_close?: Returns whether field
|
|
2380
|
-
#
|
|
2381
|
-
# * #connection_keep_alive?: Returns whether field
|
|
2382
|
-
#
|
|
2391
|
+
# * #chunked?: Returns whether field <code>'Transfer-Encoding'</code> is set
|
|
2392
|
+
# to <code>'chunked'</code>.
|
|
2393
|
+
# * #connection_close?: Returns whether field <code>'Connection'</code> is set
|
|
2394
|
+
# to <code>'close'</code>.
|
|
2395
|
+
# * #connection_keep_alive?: Returns whether field <code>'Connection'</code>
|
|
2396
|
+
# is set to <code>'keep-alive'</code>.
|
|
2383
2397
|
# * #key?: Returns whether a given key exists.
|
|
2384
2398
|
#
|
|
2385
2399
|
# ### Iterators
|
|
@@ -2715,8 +2729,8 @@ module Net
|
|
|
2715
2729
|
# rdoc-file=lib/net/http/header.rb
|
|
2716
2730
|
# - range()
|
|
2717
2731
|
# -->
|
|
2718
|
-
# Returns an array of Range objects that represent the value of field
|
|
2719
|
-
# or `nil` if there is no such field; see [Range request
|
|
2732
|
+
# Returns an array of Range objects that represent the value of field
|
|
2733
|
+
# <code>'Range'</code>, or `nil` if there is no such field; see [Range request
|
|
2720
2734
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request
|
|
2721
2735
|
# -header):
|
|
2722
2736
|
#
|
|
@@ -2734,7 +2748,7 @@ module Net
|
|
|
2734
2748
|
# - set_range(offset, length) -> range
|
|
2735
2749
|
# - set_range(begin..length) -> range
|
|
2736
2750
|
# -->
|
|
2737
|
-
# Sets the value for field
|
|
2751
|
+
# Sets the value for field <code>'Range'</code>; see [Range request
|
|
2738
2752
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request
|
|
2739
2753
|
# -header):
|
|
2740
2754
|
#
|
|
@@ -2769,8 +2783,8 @@ module Net
|
|
|
2769
2783
|
# rdoc-file=lib/net/http/header.rb
|
|
2770
2784
|
# - content_length()
|
|
2771
2785
|
# -->
|
|
2772
|
-
# Returns the value of field
|
|
2773
|
-
# is no such field; see [Content-Length request
|
|
2786
|
+
# Returns the value of field <code>'Content-Length'</code> as an integer, or
|
|
2787
|
+
# `nil` if there is no such field; see [Content-Length request
|
|
2774
2788
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-lengt
|
|
2775
2789
|
# h-request-header):
|
|
2776
2790
|
#
|
|
@@ -2785,8 +2799,8 @@ module Net
|
|
|
2785
2799
|
# rdoc-file=lib/net/http/header.rb
|
|
2786
2800
|
# - content_length=(len)
|
|
2787
2801
|
# -->
|
|
2788
|
-
# Sets the value of field
|
|
2789
|
-
# [Content-Length response
|
|
2802
|
+
# Sets the value of field <code>'Content-Length'</code> to the given numeric;
|
|
2803
|
+
# see [Content-Length response
|
|
2790
2804
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-lengt
|
|
2791
2805
|
# h-response-header):
|
|
2792
2806
|
#
|
|
@@ -2807,8 +2821,8 @@ module Net
|
|
|
2807
2821
|
# rdoc-file=lib/net/http/header.rb
|
|
2808
2822
|
# - chunked?()
|
|
2809
2823
|
# -->
|
|
2810
|
-
# Returns `true` if field
|
|
2811
|
-
#
|
|
2824
|
+
# Returns `true` if field <code>'Transfer-Encoding'</code> exists and has value
|
|
2825
|
+
# <code>'chunked'</code>, `false` otherwise; see [Transfer-Encoding response
|
|
2812
2826
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#transfer-enco
|
|
2813
2827
|
# ding-response-header):
|
|
2814
2828
|
#
|
|
@@ -2822,8 +2836,9 @@ module Net
|
|
|
2822
2836
|
# rdoc-file=lib/net/http/header.rb
|
|
2823
2837
|
# - content_range()
|
|
2824
2838
|
# -->
|
|
2825
|
-
# Returns a Range object representing the value of field
|
|
2826
|
-
# `nil` if no such field exists; see
|
|
2839
|
+
# Returns a Range object representing the value of field
|
|
2840
|
+
# <code>'Content-Range'</code>, or `nil` if no such field exists; see
|
|
2841
|
+
# [Content-Range response
|
|
2827
2842
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range
|
|
2828
2843
|
# -response-header):
|
|
2829
2844
|
#
|
|
@@ -2840,8 +2855,8 @@ module Net
|
|
|
2840
2855
|
# - range_length()
|
|
2841
2856
|
# -->
|
|
2842
2857
|
# Returns the integer representing length of the value of field
|
|
2843
|
-
#
|
|
2844
|
-
# response
|
|
2858
|
+
# <code>'Content-Range'</code>, or `nil` if no such field exists; see
|
|
2859
|
+
# [Content-Range response
|
|
2845
2860
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range
|
|
2846
2861
|
# -response-header):
|
|
2847
2862
|
#
|
|
@@ -2857,8 +2872,8 @@ module Net
|
|
|
2857
2872
|
# - content_type()
|
|
2858
2873
|
# -->
|
|
2859
2874
|
# Returns the [media type](https://en.wikipedia.org/wiki/Media_type) from the
|
|
2860
|
-
# value of field
|
|
2861
|
-
# [Content-Type response
|
|
2875
|
+
# value of field <code>'Content-Type'</code>, or `nil` if no such field exists;
|
|
2876
|
+
# see [Content-Type response
|
|
2862
2877
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-
|
|
2863
2878
|
# response-header):
|
|
2864
2879
|
#
|
|
@@ -2874,7 +2889,8 @@ module Net
|
|
|
2874
2889
|
# -->
|
|
2875
2890
|
# Returns the leading ('type') part of the [media
|
|
2876
2891
|
# type](https://en.wikipedia.org/wiki/Media_type) from the value of field
|
|
2877
|
-
#
|
|
2892
|
+
# <code>'Content-Type'</code>, or `nil` if no such field exists; see
|
|
2893
|
+
# [Content-Type response
|
|
2878
2894
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-
|
|
2879
2895
|
# response-header):
|
|
2880
2896
|
#
|
|
@@ -2890,7 +2906,8 @@ module Net
|
|
|
2890
2906
|
# -->
|
|
2891
2907
|
# Returns the trailing ('subtype') part of the [media
|
|
2892
2908
|
# type](https://en.wikipedia.org/wiki/Media_type) from the value of field
|
|
2893
|
-
#
|
|
2909
|
+
# <code>'Content-Type'</code>, or `nil` if no such field exists; see
|
|
2910
|
+
# [Content-Type response
|
|
2894
2911
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-
|
|
2895
2912
|
# response-header):
|
|
2896
2913
|
#
|
|
@@ -2905,7 +2922,8 @@ module Net
|
|
|
2905
2922
|
# - type_params()
|
|
2906
2923
|
# -->
|
|
2907
2924
|
# Returns the trailing ('parameters') part of the value of field
|
|
2908
|
-
#
|
|
2925
|
+
# <code>'Content-Type'</code>, or `nil` if no such field exists; see
|
|
2926
|
+
# [Content-Type response
|
|
2909
2927
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-
|
|
2910
2928
|
# response-header):
|
|
2911
2929
|
#
|
|
@@ -2919,8 +2937,8 @@ module Net
|
|
|
2919
2937
|
# rdoc-file=lib/net/http/header.rb
|
|
2920
2938
|
# - set_content_type(type, params = {})
|
|
2921
2939
|
# -->
|
|
2922
|
-
# Sets the value of field
|
|
2923
|
-
# [Content-Type request
|
|
2940
|
+
# Sets the value of field <code>'Content-Type'</code>; returns the new value;
|
|
2941
|
+
# see [Content-Type request
|
|
2924
2942
|
# header](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-
|
|
2925
2943
|
# request-header):
|
|
2926
2944
|
#
|
|
@@ -2944,8 +2962,8 @@ module Net
|
|
|
2944
2962
|
# - set_form_data(params, sep = '&')
|
|
2945
2963
|
# -->
|
|
2946
2964
|
# Sets the request body to a URL-encoded string derived from argument `params`,
|
|
2947
|
-
# and sets request header field
|
|
2948
|
-
#
|
|
2965
|
+
# and sets request header field <code>'Content-Type'</code> to
|
|
2966
|
+
# <code>'application/x-www-form-urlencoded'</code>.
|
|
2949
2967
|
#
|
|
2950
2968
|
# The resulting request is suitable for HTTP request `POST` or `PUT`.
|
|
2951
2969
|
#
|
|
@@ -2953,7 +2971,7 @@ module Net
|
|
|
2953
2971
|
# [URI.encode_www_form](rdoc-ref:URI.encode_www_form).
|
|
2954
2972
|
#
|
|
2955
2973
|
# With only argument `params` given, sets the body to a URL-encoded string with
|
|
2956
|
-
# the default separator
|
|
2974
|
+
# the default separator <code>'&'</code>:
|
|
2957
2975
|
#
|
|
2958
2976
|
# req = Net::HTTP::Post.new('example.com')
|
|
2959
2977
|
#
|
|
@@ -3001,7 +3019,7 @@ module Net
|
|
|
3001
3019
|
#
|
|
3002
3020
|
# Argument `params` should be an
|
|
3003
3021
|
# [Enumerable](rdoc-ref:Enumerable@Enumerable+in+Ruby+Classes) (method
|
|
3004
|
-
#
|
|
3022
|
+
# <code>params.map</code> will be called), and is often an array or hash.
|
|
3005
3023
|
#
|
|
3006
3024
|
# First, we set up a request:
|
|
3007
3025
|
#
|
|
@@ -3009,7 +3027,7 @@ module Net
|
|
|
3009
3027
|
# _uri.path ='/posts'
|
|
3010
3028
|
# req = Net::HTTP::Post.new(_uri)
|
|
3011
3029
|
#
|
|
3012
|
-
#
|
|
3030
|
+
# <strong>Argument `params` As an Array</strong>
|
|
3013
3031
|
#
|
|
3014
3032
|
# When `params` is an array, each of its elements is a subarray that defines a
|
|
3015
3033
|
# field; the subarray may contain:
|
|
@@ -3022,7 +3040,8 @@ module Net
|
|
|
3022
3040
|
#
|
|
3023
3041
|
# req.set_form([%w[foo 0], %w[bar 1], %w[baz 2]])
|
|
3024
3042
|
#
|
|
3025
|
-
# * When argument `enctype` (see below) is given as
|
|
3043
|
+
# * When argument `enctype` (see below) is given as
|
|
3044
|
+
# <code>'multipart/form-data'</code>:
|
|
3026
3045
|
#
|
|
3027
3046
|
# * A string name and an IO stream opened for reading:
|
|
3028
3047
|
#
|
|
@@ -3032,8 +3051,8 @@ module Net
|
|
|
3032
3051
|
# * A string name, an IO stream opened for reading, and an options hash,
|
|
3033
3052
|
# which may contain these entries:
|
|
3034
3053
|
#
|
|
3035
|
-
# *
|
|
3036
|
-
# *
|
|
3054
|
+
# * <code>:filename</code>: The name of the file to use.
|
|
3055
|
+
# * <code>:content_type</code>: The content type of the uploaded file.
|
|
3037
3056
|
#
|
|
3038
3057
|
# Example:
|
|
3039
3058
|
#
|
|
@@ -3043,7 +3062,7 @@ module Net
|
|
|
3043
3062
|
#
|
|
3044
3063
|
# req.set_form(['foo', %w[bar 1], ['file', file]])
|
|
3045
3064
|
#
|
|
3046
|
-
#
|
|
3065
|
+
# <strong>Argument `params` As a Hash</strong>
|
|
3047
3066
|
#
|
|
3048
3067
|
# When `params` is a hash, each of its entries is a name/value pair that defines
|
|
3049
3068
|
# a field:
|
|
@@ -3054,7 +3073,7 @@ module Net
|
|
|
3054
3073
|
# * `nil`.
|
|
3055
3074
|
# * Another string.
|
|
3056
3075
|
# * An IO stream opened for reading (only when argument `enctype` -- see
|
|
3057
|
-
# below -- is given as
|
|
3076
|
+
# below -- is given as <code>'multipart/form-data'</code>).
|
|
3058
3077
|
#
|
|
3059
3078
|
# Examples:
|
|
3060
3079
|
#
|
|
@@ -3072,21 +3091,22 @@ module Net
|
|
|
3072
3091
|
# req.set_form({'foo' => nil, 'bar' => 1, 'file' => file})
|
|
3073
3092
|
#
|
|
3074
3093
|
# Optional argument `enctype` specifies the value to be given to field
|
|
3075
|
-
#
|
|
3094
|
+
# <code>'Content-Type'</code>, and must be one of:
|
|
3076
3095
|
#
|
|
3077
|
-
# *
|
|
3078
|
-
# *
|
|
3096
|
+
# * <code>'application/x-www-form-urlencoded'</code> (the default).
|
|
3097
|
+
# * <code>'multipart/form-data'</code>; see [RFC
|
|
3079
3098
|
# 7578](https://www.rfc-editor.org/rfc/rfc7578).
|
|
3080
3099
|
#
|
|
3081
3100
|
# Optional argument `formopt` is a hash of options (applicable only when
|
|
3082
|
-
# argument `enctype` is
|
|
3083
|
-
# entries:
|
|
3101
|
+
# argument `enctype` is <code>'multipart/form-data'</code>) that may include the
|
|
3102
|
+
# following entries:
|
|
3084
3103
|
#
|
|
3085
|
-
# *
|
|
3086
|
-
# If not given, the boundary is a random string. See
|
|
3104
|
+
# * <code>:boundary</code>: The value is the boundary string for the multipart
|
|
3105
|
+
# message. If not given, the boundary is a random string. See
|
|
3087
3106
|
# [Boundary](https://www.rfc-editor.org/rfc/rfc7578#section-4.1).
|
|
3088
|
-
# *
|
|
3089
|
-
# names and values of non-file fields should be encoded with this
|
|
3107
|
+
# * <code>:charset</code>: Value is the character set for the form submission.
|
|
3108
|
+
# Field names and values of non-file fields should be encoded with this
|
|
3109
|
+
# charset.
|
|
3090
3110
|
#
|
|
3091
3111
|
def set_form: (Hash[untyped, untyped] params, ?String enctype, ?Hash[untyped, untyped] formopt) -> void
|
|
3092
3112
|
|
|
@@ -3094,8 +3114,8 @@ module Net
|
|
|
3094
3114
|
# rdoc-file=lib/net/http/header.rb
|
|
3095
3115
|
# - basic_auth(account, password)
|
|
3096
3116
|
# -->
|
|
3097
|
-
# Sets header
|
|
3098
|
-
# strings:
|
|
3117
|
+
# Sets header <code>'Authorization'</code> using the given `account` and
|
|
3118
|
+
# `password` strings:
|
|
3099
3119
|
#
|
|
3100
3120
|
# req.basic_auth('my_account', 'my_password')
|
|
3101
3121
|
# req['Authorization']
|
|
@@ -3107,8 +3127,8 @@ module Net
|
|
|
3107
3127
|
# rdoc-file=lib/net/http/header.rb
|
|
3108
3128
|
# - proxy_basic_auth(account, password)
|
|
3109
3129
|
# -->
|
|
3110
|
-
# Sets header
|
|
3111
|
-
# strings:
|
|
3130
|
+
# Sets header <code>'Proxy-Authorization'</code> using the given `account` and
|
|
3131
|
+
# `password` strings:
|
|
3112
3132
|
#
|
|
3113
3133
|
# req.proxy_basic_auth('my_account', 'my_password')
|
|
3114
3134
|
# req['Proxy-Authorization']
|
|
@@ -3743,8 +3763,8 @@ module Net
|
|
|
3743
3763
|
#
|
|
3744
3764
|
# ## About the Examples
|
|
3745
3765
|
#
|
|
3746
|
-
# Examples here assume that
|
|
3747
|
-
# `uri`):
|
|
3766
|
+
# Examples here assume that <code>net/http</code> has been required (which also
|
|
3767
|
+
# requires `uri`):
|
|
3748
3768
|
#
|
|
3749
3769
|
# require 'net/http'
|
|
3750
3770
|
#
|
|
@@ -3796,7 +3816,7 @@ module Net
|
|
|
3796
3816
|
# Class Net::HTTPResponse includes module Net::HTTPHeader, which provides access
|
|
3797
3817
|
# to response header values via (among others):
|
|
3798
3818
|
#
|
|
3799
|
-
# * Hash-like method
|
|
3819
|
+
# * Hash-like method <code>[]</code>.
|
|
3800
3820
|
# * Specific reader methods, such as `content_type`.
|
|
3801
3821
|
#
|
|
3802
3822
|
# Examples:
|
|
@@ -4280,12 +4300,13 @@ module Net
|
|
|
4280
4300
|
end
|
|
4281
4301
|
|
|
4282
4302
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
4283
|
-
# Response class for
|
|
4284
|
-
# 203).
|
|
4303
|
+
# Response class for <code>Non-Authoritative Information</code> responses
|
|
4304
|
+
# (status code 203).
|
|
4285
4305
|
#
|
|
4286
|
-
# The
|
|
4287
|
-
# transforming proxy (such as a Web accelerator) that received a 200
|
|
4288
|
-
# from its origin, and is returning a modified version of the
|
|
4306
|
+
# The <code>Non-Authoritative Information</code> response indicates that the
|
|
4307
|
+
# server is a transforming proxy (such as a Web accelerator) that received a 200
|
|
4308
|
+
# OK response from its origin, and is returning a modified version of the
|
|
4309
|
+
# origin's response.
|
|
4289
4310
|
#
|
|
4290
4311
|
# This class also includes (indirectly) module Net::HTTPHeader, which gives
|
|
4291
4312
|
# access to its [methods for getting headers](rdoc-ref:Net::HTTPHeader@Getters).
|
|
@@ -4365,11 +4386,12 @@ module Net
|
|
|
4365
4386
|
end
|
|
4366
4387
|
|
|
4367
4388
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
4368
|
-
# Response class for
|
|
4389
|
+
# Response class for <code>Multi-Status (WebDAV)</code> responses (status code
|
|
4390
|
+
# 207).
|
|
4369
4391
|
#
|
|
4370
|
-
# The
|
|
4371
|
-
# the request, and that the message body can contain a number of
|
|
4372
|
-
# response codes.
|
|
4392
|
+
# The <code>Multi-Status (WebDAV)</code> response indicates that the server has
|
|
4393
|
+
# received the request, and that the message body can contain a number of
|
|
4394
|
+
# separate response codes.
|
|
4373
4395
|
#
|
|
4374
4396
|
# This class also includes (indirectly) module Net::HTTPHeader, which gives
|
|
4375
4397
|
# access to its [methods for getting headers](rdoc-ref:Net::HTTPHeader@Getters).
|
|
@@ -4384,12 +4406,13 @@ module Net
|
|
|
4384
4406
|
end
|
|
4385
4407
|
|
|
4386
4408
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
4387
|
-
# Response class for
|
|
4409
|
+
# Response class for <code>Already Reported (WebDAV)</code> responses (status
|
|
4410
|
+
# code 208).
|
|
4388
4411
|
#
|
|
4389
|
-
# The
|
|
4390
|
-
# received the request, and that the members of a DAV binding have already
|
|
4391
|
-
# enumerated in a preceding part of the (multi-status) response, and are
|
|
4392
|
-
# being included again.
|
|
4412
|
+
# The <code>Already Reported (WebDAV)</code> response indicates that the server
|
|
4413
|
+
# has received the request, and that the members of a DAV binding have already
|
|
4414
|
+
# been enumerated in a preceding part of the (multi-status) response, and are
|
|
4415
|
+
# not being included again.
|
|
4393
4416
|
#
|
|
4394
4417
|
# This class also includes (indirectly) module Net::HTTPHeader, which gives
|
|
4395
4418
|
# access to its [methods for getting headers](rdoc-ref:Net::HTTPHeader@Getters).
|
|
@@ -5003,7 +5026,7 @@ module Net
|
|
|
5003
5026
|
end
|
|
5004
5027
|
|
|
5005
5028
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
5006
|
-
# Response class for
|
|
5029
|
+
# Response class for <code>Locked (WebDAV)</code> responses (status code 423).
|
|
5007
5030
|
#
|
|
5008
5031
|
# The requested resource is locked.
|
|
5009
5032
|
#
|
|
@@ -5020,7 +5043,8 @@ module Net
|
|
|
5020
5043
|
end
|
|
5021
5044
|
|
|
5022
5045
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
5023
|
-
# Response class for
|
|
5046
|
+
# Response class for <code>Failed Dependency (WebDAV)</code> responses (status
|
|
5047
|
+
# code 424).
|
|
5024
5048
|
#
|
|
5025
5049
|
# The request failed because it depended on another request and that request
|
|
5026
5050
|
# failed. See [424 Failed Dependency
|
|
@@ -5278,8 +5302,8 @@ module Net
|
|
|
5278
5302
|
end
|
|
5279
5303
|
|
|
5280
5304
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
5281
|
-
# Response class for
|
|
5282
|
-
# 507).
|
|
5305
|
+
# Response class for <code>Insufficient Storage (WebDAV)</code> responses
|
|
5306
|
+
# (status code 507).
|
|
5283
5307
|
#
|
|
5284
5308
|
# The server is unable to store the representation needed to complete the
|
|
5285
5309
|
# request.
|
|
@@ -5298,7 +5322,8 @@ module Net
|
|
|
5298
5322
|
end
|
|
5299
5323
|
|
|
5300
5324
|
# <!-- rdoc-file=lib/net/http/responses.rb -->
|
|
5301
|
-
# Response class for
|
|
5325
|
+
# Response class for <code>Loop Detected (WebDAV)</code> responses (status code
|
|
5326
|
+
# 508).
|
|
5302
5327
|
#
|
|
5303
5328
|
# The server detected an infinite loop while processing the request.
|
|
5304
5329
|
#
|
|
@@ -5357,8 +5382,8 @@ module Net
|
|
|
5357
5382
|
#
|
|
5358
5383
|
# ## About the Examples
|
|
5359
5384
|
#
|
|
5360
|
-
# Examples here assume that
|
|
5361
|
-
# `uri`):
|
|
5385
|
+
# Examples here assume that <code>net/http</code> has been required (which also
|
|
5386
|
+
# requires `uri`):
|
|
5362
5387
|
#
|
|
5363
5388
|
# require 'net/http'
|
|
5364
5389
|
#
|
|
@@ -5410,7 +5435,7 @@ module Net
|
|
|
5410
5435
|
# Class Net::HTTPResponse includes module Net::HTTPHeader, which provides access
|
|
5411
5436
|
# to response header values via (among others):
|
|
5412
5437
|
#
|
|
5413
|
-
# * Hash-like method
|
|
5438
|
+
# * Hash-like method <code>[]</code>.
|
|
5414
5439
|
# * Specific reader methods, such as `content_type`.
|
|
5415
5440
|
#
|
|
5416
5441
|
# Examples:
|