Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/net/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class HTTPHeaderSyntaxError < StandardError; end
# - If you will make only a few requests of all kinds,
# consider using the various singleton convenience methods in this class.
# Each of the following methods automatically starts and finishes
# a {session}[rdoc-ref:Net::HTTP@Sessions] that sends a single request:
# a {session}[rdoc-ref:Net::HTTPSession@HTTP+Sessions] that sends a single request:
#
# # Return string response body.
# Net::HTTP.get(hostname, path)
Expand All @@ -71,7 +71,7 @@ class HTTPHeaderSyntaxError < StandardError; end
# Net::HTTP.put(uri, data)
#
# - If performance is important, consider using sessions, which lower request overhead.
# This {session}[rdoc-ref:Net::HTTP@Sessions] has multiple requests for
# This {session}[rdoc-ref:Net::HTTPSession@HTTP+Sessions] has multiple requests for
# {HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods]
# and {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]:
#
Expand Down Expand Up @@ -183,7 +183,7 @@ class HTTPHeaderSyntaxError < StandardError; end
# - May contain any number of requests.
# - Is ended by instance method Net::HTTP#finish.
#
# See example sessions at {Strategies}[rdoc-ref:Net::HTTP@Strategies].
# See example sessions at {Strategies}[rdoc-ref:Net::HTTPSession@Strategies].
#
# === Session Using \Net::HTTP.start
#
Expand Down Expand Up @@ -1095,7 +1095,7 @@ class << HTTP
# http.port # => 8000
#
# For proxy-defining arguments +p_addr+ through +p_no_proxy+,
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
# see {Proxy Server}[rdoc-ref:Net::HTTPSession@Proxy+Server].
#
def HTTP.new(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, p_no_proxy = nil, p_use_ssl = nil)
http = super address, port
Expand Down Expand Up @@ -1303,11 +1303,11 @@ def response_body_encoding=(value)

# Sets whether to determine the proxy from environment variable
# '<tt>ENV['http_proxy']</tt>';
# see {Proxy Using ENV['http_proxy']}[rdoc-ref:Net::HTTP@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27].
# see {Proxy Using ENV['http_proxy']}[rdoc-ref:Net::HTTPSession@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27].
attr_writer :proxy_from_env

# Sets the proxy address;
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
# see {Proxy Server}[rdoc-ref:Net::HTTPSession@Proxy+Server].
attr_writer :proxy_address

# Sets the proxy port;
Expand Down Expand Up @@ -1848,14 +1848,14 @@ def proxy_class?
end

# Returns +true+ if a proxy server is defined, +false+ otherwise;
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
# see {Proxy Server}[rdoc-ref:Net::HTTPSession@Proxy+Server].
def proxy?
!!(@proxy_from_env ? proxy_uri : @proxy_address)
end

# Returns +true+ if the proxy server is defined in the environment,
# +false+ otherwise;
# see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
# see {Proxy Server}[rdoc-ref:Net::HTTPSession@Proxy+Server].
def proxy_from_env?
@proxy_from_env
end
Expand Down
2 changes: 1 addition & 1 deletion lib/net/http/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# See:
#
# - {Request header Accept-Encoding}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Accept-Encoding]
# and {Compression and Decompression}[rdoc-ref:Net::HTTP@Compression+and+Decompression].
# and {Compression and Decompression}[rdoc-ref:Net::HTTPSession@Compression+and+Decompression].
# - {Request header Accept}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#accept-request-header].
# - {Request header User-Agent}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#user-agent-request-header].
# - {Request header Host}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#host-request-header].
Expand Down
Loading