@@ -368,7 +368,7 @@ class HTTPHeaderSyntaxError < StandardError; end
368
368
# http.proxy_user # => "pname"
369
369
# http.proxy_pass # => "ppass"
370
370
#
371
- # === Proxy Using <tt>ENV['http_proxy']</tt>
371
+ # === Proxy Using ' <tt>ENV['http_proxy']</tt>'
372
372
#
373
373
# When environment variable <tt>'http_proxy'</tt>
374
374
# is set to a \URI string,
@@ -826,7 +826,7 @@ def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_p
826
826
# Creates a new \Net::HTTP object for the specified server address,
827
827
# without opening the TCP connection or initializing the \HTTP session.
828
828
# The +address+ should be a DNS hostname or IP address.
829
- def initialize ( address , port = nil )
829
+ def initialize ( address , port = nil ) # :nodoc:
830
830
@address = address
831
831
@port = ( port || HTTP . default_port )
832
832
@ipaddr = nil
@@ -926,21 +926,22 @@ def set_debug_output(output)
926
926
@debug_output = output
927
927
end
928
928
929
- # The DNS host name or IP address to connect to .
929
+ # Returns the string host name or host IP given as argument +address+ in ::new .
930
930
attr_reader :address
931
931
932
- # The port number to connect to .
932
+ # Returns the integer port number given as argument +port+ in ::new .
933
933
attr_reader :port
934
934
935
- # The local host used to establish the connection.
935
+ # Sets or returns the string local host used to establish the connection;
936
+ # initially +nil+.
936
937
attr_accessor :local_host
937
938
938
- # The local port used to establish the connection.
939
+ # Sets or returns the integer local port used to establish the connection;
940
+ # initially +nil+.
939
941
attr_accessor :local_port
940
942
941
- # The encoding to use for the response body. If Encoding, uses the
942
- # specified encoding. If other true value, tries to detect the response
943
- # body encoding.
943
+ # Returns the encoding to use for the response body;
944
+ # see #response_body_encoding=.
944
945
attr_reader :response_body_encoding
945
946
946
947
# Sets the encoding to be used for the response body;
@@ -966,10 +967,25 @@ def response_body_encoding=(value)
966
967
@response_body_encoding = value
967
968
end
968
969
970
+ # Sets whether to determine the proxy from environment variable
971
+ # '<tt>ENV['http_proxy']</tt>';
972
+ # see {Proxy Using ENV['http_proxy']}[rdoc-ref:Net::HTTP@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27].
969
973
attr_writer :proxy_from_env
974
+
975
+ # Sets the proxy address;
976
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
970
977
attr_writer :proxy_address
978
+
979
+ # Sets the proxy port;
980
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
971
981
attr_writer :proxy_port
982
+
983
+ # Sets the proxy user;
984
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
972
985
attr_writer :proxy_user
986
+
987
+ # Sets the proxy password;
988
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
973
989
attr_writer :proxy_pass
974
990
975
991
# Returns the IP address for the connection.
@@ -1008,23 +1024,21 @@ def ipaddr=(addr)
1008
1024
@ipaddr = addr
1009
1025
end
1010
1026
1011
- # Number of seconds to wait for the connection to open. Any number
1012
- # may be used, including Floats for fractional seconds. If the \HTTP
1013
- # object cannot open a connection in this many seconds, it raises a
1014
- # \Net::OpenTimeout exception. The default value is 60 seconds.
1027
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
1028
+ # to wait for a connection to open;
1029
+ # initially 60.
1030
+ # If the connection is not made in the given interval,
1031
+ # an exception is raised.
1015
1032
attr_accessor :open_timeout
1016
1033
1017
- # Number of seconds to wait for one block to be read (via one read(2)
1018
- # call). Any number may be used, including Floats for fractional
1019
- # seconds. If the \HTTP object cannot read data in this many seconds,
1020
- # it raises a Net::ReadTimeout exception. The default value is 60 seconds.
1034
+ # Returns the numeric (\Integer or \Float) number of seconds
1035
+ # to wait for one block to be read (via one read(2) call);
1036
+ # see #read_timeout=.
1021
1037
attr_reader :read_timeout
1022
1038
1023
- # Number of seconds to wait for one block to be written (via one write(2)
1024
- # call). Any number may be used, including Floats for fractional
1025
- # seconds. If the \HTTP object cannot write data in this many seconds,
1026
- # it raises a \Net::WriteTimeout exception. The default value is 60 seconds.
1027
- # \Net::WriteTimeout is not raised on Windows.
1039
+ # Returns the numeric (\Integer or \Float) number of seconds
1040
+ # to wait for one block to be written (via one write(2) call);
1041
+ # see #write_timeout=.
1028
1042
attr_reader :write_timeout
1029
1043
1030
1044
# Sets the maximum number of times to retry an idempotent request in case of
@@ -1047,6 +1061,8 @@ def max_retries=(retries)
1047
1061
@max_retries = retries
1048
1062
end
1049
1063
1064
+ # Returns the maximum number of times to retry an idempotent request;
1065
+ # see #max_retries=.
1050
1066
attr_reader :max_retries
1051
1067
1052
1068
# Sets the read timeout, in seconds, for +self+ to integer +sec+;
@@ -1089,9 +1105,8 @@ def write_timeout=(sec)
1089
1105
@write_timeout = sec
1090
1106
end
1091
1107
1092
- # Returns the continue timeout value.
1093
- # See Net::HTTP.continue_timeout=.
1094
- #
1108
+ # Returns the continue timeout value;
1109
+ # see continue_timeout=.
1095
1110
attr_reader :continue_timeout
1096
1111
1097
1112
# Sets the continue timeout value,
@@ -1103,14 +1118,18 @@ def continue_timeout=(sec)
1103
1118
@continue_timeout = sec
1104
1119
end
1105
1120
1106
- # Seconds to reuse the connection of the previous request.
1107
- # If the idle time is less than this Keep-Alive Timeout,
1108
- # \Net::HTTP reuses the TCP/IP socket used by the previous communication.
1109
- # The default value is 2 seconds.
1121
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
1122
+ # to keep the connection open after a request is sent;
1123
+ # initially 2.
1124
+ # If a new request is made during the given interval,
1125
+ # the still-open connection is used;
1126
+ # otherwise the connection will have been closed
1127
+ # and a new connection is opened.
1110
1128
attr_accessor :keep_alive_timeout
1111
1129
1112
- # Whether to ignore EOF when reading response bodies with defined
1113
- # Content-Length headers. For backwards compatibility, the default is true.
1130
+ # Sets or returns whether to ignore end-of-file when reading a response body
1131
+ # with <tt>Content-Length</tt> headers;
1132
+ # initially +true+.
1114
1133
attr_accessor :ignore_eof
1115
1134
1116
1135
# Returns +true+ if the \HTTP session has been started:
@@ -1133,6 +1152,8 @@ def started?
1133
1152
1134
1153
alias active? started? #:nodoc: obsolete
1135
1154
1155
+ # Sets or returns whether to close the connection when the response is empty;
1156
+ # initially +false+.
1136
1157
attr_accessor :close_on_empty_response
1137
1158
1138
1159
# Returns +true+ if +self+ uses SSL, +false+ otherwise.
@@ -1171,7 +1192,7 @@ def use_ssl=(flag)
1171
1192
:@verify_depth ,
1172
1193
:@verify_mode ,
1173
1194
:@verify_hostname ,
1174
- ]
1195
+ ] # :nodoc:
1175
1196
SSL_ATTRIBUTES = [
1176
1197
:ca_file ,
1177
1198
:ca_path ,
@@ -1188,7 +1209,7 @@ def use_ssl=(flag)
1188
1209
:verify_depth ,
1189
1210
:verify_mode ,
1190
1211
:verify_hostname ,
1191
- ]
1212
+ ] # :nodoc:
1192
1213
1193
1214
# Sets path of a CA certification file in PEM format.
1194
1215
#
0 commit comments