mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Improve Net::HTTP docs:
* Make links from Net::GenericHTTPRequest work; * Document +dest+ param of HTTPResponse#read_body; * Slightly improve reference to particular response classes from HTTPResponse class docs.
This commit is contained in:
parent
f93cb6904c
commit
6221248294
Notes:
git
2019-10-27 02:25:03 +09:00
2 changed files with 12 additions and 6 deletions
|
@ -1,8 +1,8 @@
|
|||
# frozen_string_literal: false
|
||||
# HTTPGenericRequest is the parent of the HTTPRequest class.
|
||||
# Do not use this directly; use a subclass of HTTPRequest.
|
||||
# HTTPGenericRequest is the parent of the Net::HTTPRequest class.
|
||||
# Do not use this directly; use a subclass of Net::HTTPRequest.
|
||||
#
|
||||
# Mixes in the HTTPHeader module to provide easier access to HTTP headers.
|
||||
# Mixes in the Net::HTTPHeader module to provide easier access to HTTP headers.
|
||||
#
|
||||
class Net::HTTPGenericRequest
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
# header values both via hash-like methods and via individual readers.
|
||||
#
|
||||
# Note that each possible HTTP response code defines its own
|
||||
# HTTPResponse subclass. These are listed below.
|
||||
# HTTPResponse subclass. All classes are defined under the Net module.
|
||||
# Indentation indicates inheritance. For a list of the classes see Net::HTTP.
|
||||
#
|
||||
# All classes are defined under the Net module. Indentation indicates
|
||||
# inheritance. For a list of the classes see Net::HTTP.
|
||||
# Correspondense <code>HTTP code => class</code> is stored in CODE_TO_OBJ
|
||||
# constant:
|
||||
#
|
||||
# Net::HTTPResponse::CODE_TO_OBJ['404'] #=> Net::HTTPNotFound
|
||||
#
|
||||
class Net::HTTPResponse
|
||||
class << self
|
||||
|
@ -174,6 +176,10 @@ class Net::HTTPResponse
|
|||
# If a block is given, the body is passed to the block, and
|
||||
# the body is provided in fragments, as it is read in from the socket.
|
||||
#
|
||||
# If +dest+ argument is given, response is read into that variable,
|
||||
# with <code>dest#<<</code> method (it could be String or IO, or any
|
||||
# other object responding to <code><<</code>).
|
||||
#
|
||||
# Calling this method a second or subsequent time for the same
|
||||
# HTTPResponse object will return the value already read.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue