D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Net
/
Filename :
cdesc-Net.ri
back
Copy
U:RDoc::NormalModule[iI"Net:ET@0o:RDoc::Markup::Document:@parts[o;;[ : @fileI"lib/net/http/exceptions.rb;T:0@omit_headings_from_table_of_contents_below0o;;[ ; I"lib/net/http/responses.rb;T; 0; 0; 0[ [U:RDoc::Constant[i I"HTTPSession;TI"Net::HTTPSession;T:publicI"Net::HTTP;To;;[�o:RDoc::Markup::Paragraph;[I"J\Class \Net::HTTP provides a rich library that implements the client ;TI"Min a client-server model that uses the \HTTP request-response protocol. ;TI"&For information about \HTTP, see:;To:RDoc::Markup::BlankLine o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"^{Hypertext Transfer Protocol}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol].;To;;0;[o; ;[I"h{Technical overview}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Technical_overview].;T@S:RDoc::Markup::Heading: leveli: textI"About the Examples;T@o; ;[I"CExamples here assume that <tt>net/http</tt> has been required ;TI"!(which also requires +uri+):;T@o:RDoc::Markup::Verbatim;[I"require 'net/http' ;T:@format0o; ;[I"8Many code examples here use these example websites:;T@o;;;;[o;;0;[o; ;[I"*https://jsonplaceholder.typicode.com.;To;;0;[o; ;[I"http://example.com.;T@o; ;[I"/Some examples also assume these variables:;T@o;;[ I"8uri = URI('https://jsonplaceholder.typicode.com/') ;TI"+uri.freeze # Examples may not modify. ;TI"Ahostname = uri.hostname # => "jsonplaceholder.typicode.com" ;TI"&path = uri.path # => "/" ;TI"&port = uri.port # => 443 ;T;0o; ;[I"0So that example requests may be written as:;T@o;;[I"Net::HTTP.get(uri) ;TI",Net::HTTP.get(hostname, '/index.html') ;TI")Net::HTTP.start(hostname) do |http| ;TI" http.get('/todos/1') ;TI" http.get('/todos/2') ;TI" end ;T;0o; ;[I"^An example that needs a modified URI first duplicates +uri+, then modifies the duplicate:;T@o;;[I"_uri = uri.dup ;TI"_uri.path = '/todos/1' ;T;0S;;i;I"Strategies;T@o;;;;[o;;0;[o; ;[I"/If you will make only a few GET requests, ;TI"0consider using {OpenURI}[rdoc-ref:OpenURI].;To;;0;[o; ;[ I"8If you will make only a few requests of all kinds, ;TI"Mconsider using the various singleton convenience methods in this class. ;TI"EEach of the following methods automatically starts and finishes ;TI"Ja {session}[rdoc-ref:Net::HTTP@Sessions] that sends a single request:;T@o;;[I"$# Return string response body. ;TI"#Net::HTTP.get(hostname, path) ;TI"Net::HTTP.get(uri) ;TI" ;TI".# Write string response body to $stdout. ;TI")Net::HTTP.get_print(hostname, path) ;TI"Net::HTTP.get_print(uri) ;TI" ;TI"4# Return response as Net::HTTPResponse object. ;TI",Net::HTTP.get_response(hostname, path) ;TI"!Net::HTTP.get_response(uri) ;TI";data = '{"title": "foo", "body": "bar", "userId": 1}' ;TI"Net::HTTP.post(uri, data) ;TI"5params = {title: 'foo', body: 'bar', userId: 1} ;TI"&Net::HTTP.post_form(uri, params) ;TI";data = '{"title": "foo", "body": "bar", "userId": 1}' ;TI"Net::HTTP.put(uri, data) ;T;0o;;0;[o; ;[ I"YIf performance is important, consider using sessions, which lower request overhead. ;TI"KThis {session}[rdoc-ref:Net::HTTP@Sessions] has multiple requests for ;TI"_{HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods] ;TI"Oand {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]:;T@o;;[I")Net::HTTP.start(hostname) do |http| ;TI"? # Session started automatically before block execution. ;TI" http.get(path) ;TI" http.head(path) ;TI" body = 'Some text' ;TI"7 http.post(path, body) # Can also have a block. ;TI" http.put(path, body) ;TI" http.delete(path) ;TI" http.options(path) ;TI" http.trace(path) ;TI"7 http.patch(path, body) # Can also have a block. ;TI" http.copy(path) ;TI" http.lock(path, body) ;TI" http.mkcol(path, body) ;TI" http.move(path) ;TI"! http.propfind(path, body) ;TI"" http.proppatch(path, body) ;TI" http.unlock(path, body) ;TI"7 # Session finished automatically at block exit. ;TI" end ;T;0o; ;[I"TThe methods cited above are convenience methods that, via their few arguments, ;TI".allow minimal control over the requests. ;TI"VFor greater control, consider using {request objects}[rdoc-ref:Net::HTTPRequest].;T@S;;i;I" URIs;T@o; ;[ I"On the internet, a URI ;TI"b({Universal Resource Identifier}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]) ;TI"8is a string that identifies a particular resource. ;TI"QIt consists of some or all of: scheme, hostname, path, query, and fragment; ;TI"Xsee {URI syntax}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax].;T@o; ;[ I"9A Ruby {URI::Generic}[rdoc-ref:URI::Generic] object ;TI"!represents an internet URI. ;TI"(It provides, among others, methods ;TI";+scheme+, +hostname+, +path+, +query+, and +fragment+.;T@S;;i;I"Schemes;T@o; ;[I"An internet \URI has ;TI"Ca {scheme}[https://en.wikipedia.org/wiki/List_of_URI_schemes].;T@o; ;[I"VThe two schemes supported in \Net::HTTP are <tt>'https'</tt> and <tt>'http'</tt>:;T@o;;[I"3uri.scheme # => "https" ;TI"2URI('http://example.com').scheme # => "http" ;T;0S;;i;I"Hostnames;T@o; ;[I"IA hostname identifies a server (host) to which requests may be sent:;T@o;;[ I"Ahostname = uri.hostname # => "jsonplaceholder.typicode.com" ;TI")Net::HTTP.start(hostname) do |http| ;TI" # Some HTTP stuff. ;TI" end ;T;0S;;i;I" Paths;T@o; ;[I"<A host-specific path identifies a resource on the host:;T@o;;[ I"_uri = uri.dup ;TI"_uri.path = '/todos/1' ;TI"hostname = _uri.hostname ;TI"path = _uri.path ;TI"#Net::HTTP.get(hostname, path) ;T;0S;;i;I"Queries;T@o; ;[I"<A host-specific query adds name/value pairs to the URI:;T@o;;[ I"_uri = uri.dup ;TI",params = {userId: 1, completed: false} ;TI"._uri.query = URI.encode_www_form(params) ;TI"[_uri # => #<URI::HTTPS https://jsonplaceholder.typicode.com?userId=1&completed=false> ;TI"Net::HTTP.get(_uri) ;T;0S;;i;I"Fragments;T@o; ;[I"PA {URI fragment}[https://en.wikipedia.org/wiki/URI_fragment] has no effect ;TI"in \Net::HTTP; ;TI"Mthe same data is returned, regardless of whether a fragment is included.;T@S;;i;I"Request Headers;T@o; ;[I"MRequest headers may be used to pass additional information to the host, ;TI"3similar to arguments passed in a method call; ;TI"&each header is a name/value pair.;T@o; ;[I"EEach of the \Net::HTTP methods that sends a request to the host ;TI"&has optional argument +headers+, ;TI"Iwhere the headers are expressed as a hash of field-name/value pairs:;T@o;;[I"Fheaders = {Accept: 'application/json', Connection: 'Keep-Alive'} ;TI"!Net::HTTP.get(uri, headers) ;T;0o; ;[I"LSee lists of both standard request fields and common request fields at ;TI"`{Request Fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields]. ;TI"0A host may also accept other custom fields.;T@S;;i;I"\HTTP Sessions;T@o; ;[I"KA _session_ is a connection between a server (host) and a client that:;T@o;;;;[o;;0;[o; ;[I"1Is begun by instance method Net::HTTP#start.;To;;0;[o; ;[I"(May contain any number of requests.;To;;0;[o; ;[I"2Is ended by instance method Net::HTTP#finish.;T@o; ;[I"ISee example sessions at {Strategies}[rdoc-ref:Net::HTTP@Strategies].;T@S;;i;I"#Session Using \Net::HTTP.start;T@o; ;[I"DIf you have many requests to make to a single host (and port), ;TI"Cconsider using singleton method Net::HTTP.start with a block; ;TI"5the method handles the session automatically by:;T@o;;;;[o;;0;[o; ;[I"+Calling #start before block execution.;To;;0;[o; ;[I"Executing the block.;To;;0;[o; ;[I"+Calling #finish after block execution.;T@o; ;[I"7In the block, you can use these instance methods, ;TI"/each of which that sends a single request:;T@o;;;;[o;;0;[o; ;[I"_{HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods]:;T@o;;;;[o;;0;[o; ;[I"#get, #request_get: GET.;To;;0;[o; ;[I" #head, #request_head: HEAD.;To;;0;[o; ;[I" #post, #request_post: POST.;To;;0;[o; ;[I"#delete: DELETE.;To;;0;[o; ;[I"#options: OPTIONS.;To;;0;[o; ;[I"#trace: TRACE.;To;;0;[o; ;[I"#patch: PATCH.;T@o;;0;[o; ;[I"K{WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]:;T@o;;;;[o;;0;[o; ;[I"#copy: COPY.;To;;0;[o; ;[I"#lock: LOCK.;To;;0;[o; ;[I"#mkcol: MKCOL.;To;;0;[o; ;[I"#move: MOVE.;To;;0;[o; ;[I"#propfind: PROPFIND.;To;;0;[o; ;[I"#proppatch: PROPPATCH.;To;;0;[o; ;[I"#unlock: UNLOCK.;T@S;;i;I"9Session Using \Net::HTTP.start and \Net::HTTP.finish;T@o; ;[I"HYou can manage a session manually using methods #start and #finish:;T@o;;[I"$http = Net::HTTP.new(hostname) ;TI"http.start ;TI"http.get('/todos/1') ;TI"http.get('/todos/2') ;TI"http.delete('/posts/1') ;TI"-http.finish # Needed to free resources. ;T;0S;;i;I"Single-Request Session;T@o; ;[I"CCertain convenience methods automatically handle a session by:;T@o;;;;[ o;;0;[o; ;[I"Creating an \HTTP object;To;;0;[o; ;[I"Starting a session.;To;;0;[o; ;[I"Sending a single request.;To;;0;[o; ;[I"Finishing the session.;To;;0;[o; ;[I"Destroying the object.;T@o; ;[I")Such methods that send GET requests:;T@o;;;;[o;;0;[o; ;[I"-::get: Returns the string response body.;To;;0;[o; ;[I"=::get_print: Writes the string response body to $stdout.;To;;0;[o; ;[I"8::get_response: Returns a Net::HTTPResponse object.;T@o; ;[I"*Such methods that send POST requests:;T@o;;;;[o;;0;[o; ;[I"$::post: Posts data to the host.;To;;0;[o; ;[I".::post_form: Posts form data to the host.;T@S;;i;I"!\HTTP Requests and Responses;T@o; ;[I"8Many of the methods above are convenience methods, ;TI"8each of which sends a request and returns a string ;TI"Mwithout directly using \Net::HTTPRequest and \Net::HTTPResponse objects.;T@o; ;[I"KYou can, however, directly create a request object, send the request, ;TI"+and retrieve the response object; see:;T@o;;;;[o;;0;[o; ;[I"Net::HTTPRequest.;To;;0;[o; ;[I"Net::HTTPResponse.;T@S;;i;I"Following Redirection;T@o; ;[I"OEach returned response is an instance of a subclass of Net::HTTPResponse. ;TI"XSee the {response class hierarchy}[rdoc-ref:Net::HTTPResponse@Response+Subclasses].;T@o; ;[I"=In particular, class Net::HTTPRedirection is the parent ;TI"!of all redirection classes. ;TI"OThis allows you to craft a case statement to handle redirections properly:;T@o;;[I" def fetch(uri, limit = 10) ;TI"/ # You should choose a better exception. ;TI"D raise ArgumentError, 'Too many HTTP redirects' if limit == 0 ;TI" ;TI". res = Net::HTTP.get_response(URI(uri)) ;TI" case res ;TI"6 when Net::HTTPSuccess # Any success class. ;TI" res ;TI": when Net::HTTPRedirection # Any redirection class. ;TI"$ location = res['Location'] ;TI"* warn "Redirected to #{location}" ;TI"$ fetch(location, limit - 1) ;TI"4 else # Any other class. ;TI" res.value ;TI" end ;TI" end ;TI" ;TI"fetch(uri) ;T;0S;;i;I"Basic Authentication;T@o; ;[I"4Basic authentication is performed according to ;TI"4{RFC2617}[http://www.ietf.org/rfc/rfc2617.txt]:;T@o;;[ I"#req = Net::HTTP::Get.new(uri) ;TI"$req.basic_auth('user', 'pass') ;TI"/res = Net::HTTP.start(hostname) do |http| ;TI" http.request(req) ;TI" end ;T;0S;;i;I"Streaming Response Bodies;T@o; ;[I"MBy default \Net::HTTP reads an entire response into memory. If you are ;TI"Nhandling large files or wish to implement a progress bar you can instead ;TI"'stream the body directly to an IO.;T@o;;[I")Net::HTTP.start(hostname) do |http| ;TI"% req = Net::HTTP::Get.new(uri) ;TI"" http.request(req) do |res| ;TI"# open('t.tmp', 'w') do |f| ;TI"$ res.read_body do |chunk| ;TI" f.write chunk ;TI" end ;TI" end ;TI" end ;TI" end ;T;0S;;i;I" HTTPS;T@o; ;[I"DHTTPS is enabled for an \HTTP connection by Net::HTTP#use_ssl=:;T@o;;[ I";Net::HTTP.start(hostname, :use_ssl => true) do |http| ;TI"% req = Net::HTTP::Get.new(uri) ;TI" res = http.request(req) ;TI" end ;T;0o; ;[I"HOr if you simply want to make a GET request, you may pass in a URI ;TI"Jobject that has an \HTTPS URL. \Net::HTTP automatically turns on TLS ;TI"=verification if the URI object has a 'https' URI scheme:;T@o;;[I"Buri # => #<URI::HTTPS https://jsonplaceholder.typicode.com/> ;TI"Net::HTTP.get(uri) ;T;0S;;i;I"Proxy Server;T@o; ;[I"An \HTTP object can have ;TI"Ba {proxy server}[https://en.wikipedia.org/wiki/Proxy_server].;T@o; ;[I"8You can create an \HTTP object with a proxy server ;TI":using method Net::HTTP.new or method Net::HTTP.start.;T@o; ;[I":The proxy may be defined either by argument +p_addr+ ;TI"6or by environment variable <tt>'http_proxy'</tt>.;T@S;;i;I"/Proxy Using Argument +p_addr+ as a \String;T@o; ;[I"2When argument +p_addr+ is a string hostname, ;TI"9the returned +http+ has the given host as its proxy:;T@o;;[ I":http = Net::HTTP.new(hostname, nil, 'proxy.example') ;TI"$http.proxy? # => true ;TI"%http.proxy_from_env? # => false ;TI"/http.proxy_address # => "proxy.example" ;TI"!# These use default values. ;TI""http.proxy_port # => 80 ;TI"#http.proxy_user # => nil ;TI"#http.proxy_pass # => nil ;T;0o; ;[I"FThe port, username, and password for the proxy may also be given:;T@o;;[ I"Rhttp = Net::HTTP.new(hostname, nil, 'proxy.example', 8000, 'pname', 'ppass') ;TI"B# => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false> ;TI"$http.proxy? # => true ;TI"%http.proxy_from_env? # => false ;TI"/http.proxy_address # => "proxy.example" ;TI"$http.proxy_port # => 8000 ;TI"'http.proxy_user # => "pname" ;TI"'http.proxy_pass # => "ppass" ;T;0S;;i;I"-Proxy Using '<tt>ENV['http_proxy']</tt>';T@o; ;[ I"5When environment variable <tt>'http_proxy'</tt> ;TI"is set to a \URI string, ;TI"Hthe returned +http+ will have the server at that URI as its proxy; ;TI"4note that the \URI string must have a protocol ;TI"1such as <tt>'http'</tt> or <tt>'https'</tt>:;T@o;;[I".ENV['http_proxy'] = 'http://example.com' ;TI"$http = Net::HTTP.new(hostname) ;TI"$http.proxy? # => true ;TI"$http.proxy_from_env? # => true ;TI"-http.proxy_address # => "example.com" ;TI"!# These use default values. ;TI""http.proxy_port # => 80 ;TI"#http.proxy_user # => nil ;TI"#http.proxy_pass # => nil ;T;0o; ;[I"KThe \URI string may include proxy username, password, and port number:;T@o;;[ I"?ENV['http_proxy'] = 'http://pname:ppass@example.com:8000' ;TI"$http = Net::HTTP.new(hostname) ;TI"$http.proxy? # => true ;TI"$http.proxy_from_env? # => true ;TI"-http.proxy_address # => "example.com" ;TI"$http.proxy_port # => 8000 ;TI"'http.proxy_user # => "pname" ;TI"'http.proxy_pass # => "ppass" ;T;0S;;i;I"Filtering Proxies;T@o; ;[I":With method Net::HTTP.new (but not Net::HTTP.start), ;TI"9you can use argument +p_no_proxy+ to filter proxies:;T@o;;;;[ o;;0;[o; ;[I"Reject a certain address:;T@o;;[I"hhttp = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example') ;TI"!http.proxy_address # => nil ;T;0o;;0;[o; ;[I"*Reject certain domains or subdomains:;T@o;;[I"khttp = Net::HTTP.new('example.com', nil, 'my.proxy.example', 8000, 'pname', 'ppass', 'proxy.example') ;TI"!http.proxy_address # => nil ;T;0o;;0;[o; ;[I"4Reject certain addresses and port combinations:;T@o;;[ I"mhttp = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:1234') ;TI"-http.proxy_address # => "proxy.example" ;TI" ;TI"mhttp = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:8000') ;TI"!http.proxy_address # => nil ;T;0o;;0;[o; ;[I">Reject a list of the types above delimited using a comma:;T@o;;[ I"vhttp = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000') ;TI"!http.proxy_address # => nil ;TI" ;TI"qhttp = Net::HTTP.new('example.com', nil, 'my.proxy', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000') ;TI"!http.proxy_address # => nil ;T;0S;;i;I""Compression and Decompression;T@o; ;[I"G\Net::HTTP does not compress the body of a request before sending.;T@o; ;[I"CBy default, \Net::HTTP adds header <tt>'Accept-Encoding'</tt> ;TI":to a new {request object}[rdoc-ref:Net::HTTPRequest]:;T@o;;[I"0Net::HTTP::Get.new(uri)['Accept-Encoding'] ;TI"4# => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" ;T;0o; ;[I"OThis requests the server to zip-encode the response body if there is one; ;TI")the server is not required to do so.;T@o; ;[I"B\Net::HTTP does not automatically decompress a response body ;TI"9if the response has header <tt>'Content-Range'</tt>.;T@o; ;[I"EOtherwise decompression (or not) depends on the value of header ;TI"s{Content-Encoding}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-encoding-response-header]:;T@o;;;;[o;;0;[o; ;[I"@<tt>'deflate'</tt>, <tt>'gzip'</tt>, or <tt>'x-gzip'</tt>: ;TI"2decompresses the body and deletes the header.;To;;0;[o; ;[I"-<tt>'none'</tt> or <tt>'identity'</tt>: ;TI":does not decompress the body, but deletes the header.;To;;0;[o; ;[I"Any other value: ;TI"*leaves the body and header unchanged.;T@S;;i;I"What's Here;T@o; ;[I".First, what's elsewhere. Class Net::HTTP:;T@o;;;;[o;;0;[o; ;[I"AInherits from {class Object}[rdoc-ref:Object@What-27s+Here].;T@o; ;[I"=This is a categorized summary of methods and attributes.;T@S;;i;I"\Net::HTTP Objects;T@o;;;;[o;;0;[o; ;[I"&{::new}[rdoc-ref:Net::HTTP.new]: ;TI"Creates a new instance.;To;;0;[o; ;[I"-{#inspect}[rdoc-ref:Net::HTTP#inspect]: ;TI"/Returns a string representation of +self+.;T@S;;i;I" Sessions;T@o;;;;[ o;;0;[o; ;[I"*{::start}[rdoc-ref:Net::HTTP.start]: ;TI"5Begins a new session in a new \Net::HTTP object.;To;;0;[o; ;[I"/{#started?}[rdoc-ref:Net::HTTP#started?]: ;TI""Returns whether in a session.;To;;0;[o; ;[I"+{#finish}[rdoc-ref:Net::HTTP#finish]: ;TI"Ends an active session.;To;;0;[o; ;[I"){#start}[rdoc-ref:Net::HTTP#start]: ;TI"DBegins a new session in an existing \Net::HTTP object (+self+).;T@S;;i;I"Connections;T@o;;;;[o;;0;[o; ;[I"?{:continue_timeout}[rdoc-ref:Net::HTTP#continue_timeout]: ;TI""Returns the continue timeout.;To;;0;[o; ;[I"A{#continue_timeout=}[rdoc-ref:Net::HTTP#continue_timeout=]: ;TI"'Sets the continue timeout seconds.;To;;0;[o; ;[I"C{:keep_alive_timeout}[rdoc-ref:Net::HTTP#keep_alive_timeout]: ;TI"$Returns the keep-alive timeout.;To;;0;[o; ;[I"E{:keep_alive_timeout=}[rdoc-ref:Net::HTTP#keep_alive_timeout=]: ;TI"!Sets the keep-alive timeout.;To;;0;[o; ;[I"5{:max_retries}[rdoc-ref:Net::HTTP#max_retries]: ;TI"!Returns the maximum retries.;To;;0;[o; ;[I"7{#max_retries=}[rdoc-ref:Net::HTTP#max_retries=]: ;TI"Sets the maximum retries.;To;;0;[o; ;[I"7{:open_timeout}[rdoc-ref:Net::HTTP#open_timeout]: ;TI"Returns the open timeout.;To;;0;[o; ;[I"9{:open_timeout=}[rdoc-ref:Net::HTTP#open_timeout=]: ;TI"Sets the open timeout.;To;;0;[o; ;[I"7{:read_timeout}[rdoc-ref:Net::HTTP#read_timeout]: ;TI"Returns the open timeout.;To;;0;[o; ;[I"9{:read_timeout=}[rdoc-ref:Net::HTTP#read_timeout=]: ;TI"Sets the read timeout.;To;;0;[o; ;[I"5{:ssl_timeout}[rdoc-ref:Net::HTTP#ssl_timeout]: ;TI"Returns the ssl timeout.;To;;0;[o; ;[I"7{:ssl_timeout=}[rdoc-ref:Net::HTTP#ssl_timeout=]: ;TI"Sets the ssl timeout.;To;;0;[o; ;[I"9{:write_timeout}[rdoc-ref:Net::HTTP#write_timeout]: ;TI"Returns the write timeout.;To;;0;[o; ;[I":{write_timeout=}[rdoc-ref:Net::HTTP#write_timeout=]: ;TI"Sets the write timeout.;T@S;;i;I" Requests;T@o;;;;[o;;0;[o; ;[I"&{::get}[rdoc-ref:Net::HTTP.get]: ;TI">Sends a GET request and returns the string response body.;To;;0;[o; ;[I"2{::get_print}[rdoc-ref:Net::HTTP.get_print]: ;TI"GSends a GET request and write the string response body to $stdout.;To;;0;[o; ;[I"8{::get_response}[rdoc-ref:Net::HTTP.get_response]: ;TI"7Sends a GET request and returns a response object.;To;;0;[o; ;[I"2{::post_form}[rdoc-ref:Net::HTTP.post_form]: ;TI"GSends a POST request with form data and returns a response object.;To;;0;[o; ;[I"({::post}[rdoc-ref:Net::HTTP.post]: ;TI"BSends a POST request with data and returns a response object.;To;;0;[o; ;[I"&{::put}[rdoc-ref:Net::HTTP.put]: ;TI"ASends a PUT request with data and returns a response object.;To;;0;[o; ;[I"'{#copy}[rdoc-ref:Net::HTTP#copy]: ;TI"8Sends a COPY request and returns a response object.;To;;0;[o; ;[I"+{#delete}[rdoc-ref:Net::HTTP#delete]: ;TI":Sends a DELETE request and returns a response object.;To;;0;[o; ;[I"%{#get}[rdoc-ref:Net::HTTP#get]: ;TI"7Sends a GET request and returns a response object.;To;;0;[o; ;[I"'{#head}[rdoc-ref:Net::HTTP#head]: ;TI"8Sends a HEAD request and returns a response object.;To;;0;[o; ;[I"'{#lock}[rdoc-ref:Net::HTTP#lock]: ;TI"8Sends a LOCK request and returns a response object.;To;;0;[o; ;[I"){#mkcol}[rdoc-ref:Net::HTTP#mkcol]: ;TI"9Sends a MKCOL request and returns a response object.;To;;0;[o; ;[I"'{#move}[rdoc-ref:Net::HTTP#move]: ;TI"8Sends a MOVE request and returns a response object.;To;;0;[o; ;[I"-{#options}[rdoc-ref:Net::HTTP#options]: ;TI";Sends a OPTIONS request and returns a response object.;To;;0;[o; ;[I"){#patch}[rdoc-ref:Net::HTTP#patch]: ;TI"9Sends a PATCH request and returns a response object.;To;;0;[o; ;[I"'{#post}[rdoc-ref:Net::HTTP#post]: ;TI"8Sends a POST request and returns a response object.;To;;0;[o; ;[I"/{#propfind}[rdoc-ref:Net::HTTP#propfind]: ;TI"<Sends a PROPFIND request and returns a response object.;To;;0;[o; ;[I"1{#proppatch}[rdoc-ref:Net::HTTP#proppatch]: ;TI"=Sends a PROPPATCH request and returns a response object.;To;;0;[o; ;[I"%{#put}[rdoc-ref:Net::HTTP#put]: ;TI"7Sends a PUT request and returns a response object.;To;;0;[o; ;[I"-{#request}[rdoc-ref:Net::HTTP#request]: ;TI"3Sends a request and returns a response object.;To;;0;[o; ;[ I"5{#request_get}[rdoc-ref:Net::HTTP#request_get]: ;TI"6Sends a GET request and forms a response object; ;TI"8if a block given, calls the block with the object, ;TI""otherwise returns the object.;To;;0;[o; ;[ I"7{#request_head}[rdoc-ref:Net::HTTP#request_head]: ;TI"7Sends a HEAD request and forms a response object; ;TI"8if a block given, calls the block with the object, ;TI""otherwise returns the object.;To;;0;[o; ;[ I"7{#request_post}[rdoc-ref:Net::HTTP#request_post]: ;TI"7Sends a POST request and forms a response object; ;TI"8if a block given, calls the block with the object, ;TI""otherwise returns the object.;To;;0;[o; ;[I"7{#send_request}[rdoc-ref:Net::HTTP#send_request]: ;TI"3Sends a request and returns a response object.;To;;0;[o; ;[I"){#trace}[rdoc-ref:Net::HTTP#trace]: ;TI"9Sends a TRACE request and returns a response object.;To;;0;[o; ;[I"+{#unlock}[rdoc-ref:Net::HTTP#unlock]: ;TI";Sends an UNLOCK request and returns a response object.;T@S;;i;I"Responses;T@o;;;;[o;;0;[o; ;[I"M{:close_on_empty_response}[rdoc-ref:Net::HTTP#close_on_empty_response]: ;TI";Returns whether to close connection on empty response.;To;;0;[o; ;[I"O{:close_on_empty_response=}[rdoc-ref:Net::HTTP#close_on_empty_response=]: ;TI"8Sets whether to close connection on empty response.;To;;0;[o; ;[I"3{:ignore_eof}[rdoc-ref:Net::HTTP#ignore_eof]: ;TI"HReturns whether to ignore end-of-file when reading a response body ;TI"*with <tt>Content-Length</tt> headers.;To;;0;[o; ;[I"5{:ignore_eof=}[rdoc-ref:Net::HTTP#ignore_eof=]: ;TI"ESets whether to ignore end-of-file when reading a response body ;TI"*with <tt>Content-Length</tt> headers.;To;;0;[o; ;[I"K{:response_body_encoding}[rdoc-ref:Net::HTTP#response_body_encoding]: ;TI"7Returns the encoding to use for the response body.;To;;0;[o; ;[I"M{#response_body_encoding=}[rdoc-ref:Net::HTTP#response_body_encoding=]: ;TI"%Sets the response body encoding.;T@S;;i;I"Proxies;T@o;;;;[o;;0;[o; ;[I"9{:proxy_address}[rdoc-ref:Net::HTTP#proxy_address]: ;TI"Returns the proxy address.;To;;0;[o; ;[I";{:proxy_address=}[rdoc-ref:Net::HTTP#proxy_address=]: ;TI"Sets the proxy address.;To;;0;[o; ;[I"8{::proxy_class?}[rdoc-ref:Net::HTTP.proxy_class?]: ;TI"-Returns whether +self+ is a proxy class.;To;;0;[o; ;[I"+{#proxy?}[rdoc-ref:Net::HTTP#proxy?]: ;TI"(Returns whether +self+ has a proxy.;To;;0;[o; ;[I"9{#proxy_address}[rdoc-ref:Net::HTTP#proxy_address]: ;TI"Returns the proxy address.;To;;0;[o; ;[I"={#proxy_from_env?}[rdoc-ref:Net::HTTP#proxy_from_env?]: ;TI"EReturns whether the proxy is taken from an environment variable.;To;;0;[o; ;[I"={:proxy_from_env=}[rdoc-ref:Net::HTTP#proxy_from_env=]: ;TI"HSets whether the proxy is to be taken from an environment variable.;To;;0;[o; ;[I"3{:proxy_pass}[rdoc-ref:Net::HTTP#proxy_pass]: ;TI" Returns the proxy password.;To;;0;[o; ;[I"5{:proxy_pass=}[rdoc-ref:Net::HTTP#proxy_pass=]: ;TI"Sets the proxy password.;To;;0;[o; ;[I"3{:proxy_port}[rdoc-ref:Net::HTTP#proxy_port]: ;TI"Returns the proxy port.;To;;0;[o; ;[I"5{:proxy_port=}[rdoc-ref:Net::HTTP#proxy_port=]: ;TI"Sets the proxy port.;To;;0;[o; ;[I"3{#proxy_user}[rdoc-ref:Net::HTTP#proxy_user]: ;TI"!Returns the proxy user name.;To;;0;[o; ;[I"5{:proxy_user=}[rdoc-ref:Net::HTTP#proxy_user=]: ;TI"Sets the proxy user.;T@S;;i;I" Security;T@o;;;;[$o;;0;[o; ;[I"-{:ca_file}[rdoc-ref:Net::HTTP#ca_file]: ;TI"1Returns the path to a CA certification file.;To;;0;[o; ;[I"/{:ca_file=}[rdoc-ref:Net::HTTP#ca_file=]: ;TI".Sets the path to a CA certification file.;To;;0;[o; ;[I"-{:ca_path}[rdoc-ref:Net::HTTP#ca_path]: ;TI"HReturns the path of to CA directory containing certification files.;To;;0;[o; ;[I"/{:ca_path=}[rdoc-ref:Net::HTTP#ca_path=]: ;TI"ESets the path of to CA directory containing certification files.;To;;0;[o; ;[I"'{:cert}[rdoc-ref:Net::HTTP#cert]: ;TI"WReturns the OpenSSL::X509::Certificate object to be used for client certification.;To;;0;[o; ;[I"){:cert=}[rdoc-ref:Net::HTTP#cert=]: ;TI"TSets the OpenSSL::X509::Certificate object to be used for client certification.;To;;0;[o; ;[I"3{:cert_store}[rdoc-ref:Net::HTTP#cert_store]: ;TI"GReturns the X509::Store to be used for verifying peer certificate.;To;;0;[o; ;[I"5{:cert_store=}[rdoc-ref:Net::HTTP#cert_store=]: ;TI"DSets the X509::Store to be used for verifying peer certificate.;To;;0;[o; ;[I"-{:ciphers}[rdoc-ref:Net::HTTP#ciphers]: ;TI"'Returns the available SSL ciphers.;To;;0;[o; ;[I"/{:ciphers=}[rdoc-ref:Net::HTTP#ciphers=]: ;TI"$Sets the available SSL ciphers.;To;;0;[o; ;[I"?{:extra_chain_cert}[rdoc-ref:Net::HTTP#extra_chain_cert]: ;TI"NReturns the extra X509 certificates to be added to the certificate chain.;To;;0;[o; ;[I"A{:extra_chain_cert=}[rdoc-ref:Net::HTTP#extra_chain_cert=]: ;TI"KSets the extra X509 certificates to be added to the certificate chain.;To;;0;[o; ;[I"%{:key}[rdoc-ref:Net::HTTP#key]: ;TI"AReturns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.;To;;0;[o; ;[I"'{:key=}[rdoc-ref:Net::HTTP#key=]: ;TI">Sets the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.;To;;0;[o; ;[I"5{:max_version}[rdoc-ref:Net::HTTP#max_version]: ;TI"%Returns the maximum SSL version.;To;;0;[o; ;[I"7{:max_version=}[rdoc-ref:Net::HTTP#max_version=]: ;TI""Sets the maximum SSL version.;To;;0;[o; ;[I"5{:min_version}[rdoc-ref:Net::HTTP#min_version]: ;TI"%Returns the minimum SSL version.;To;;0;[o; ;[I"7{:min_version=}[rdoc-ref:Net::HTTP#min_version=]: ;TI""Sets the minimum SSL version.;To;;0;[o; ;[I"1{#peer_cert}[rdoc-ref:Net::HTTP#peer_cert]: ;TI"FReturns the X509 certificate chain for the session's socket peer.;To;;0;[o; ;[I"5{:ssl_version}[rdoc-ref:Net::HTTP#ssl_version]: ;TI"Returns the SSL version.;To;;0;[o; ;[I"7{:ssl_version=}[rdoc-ref:Net::HTTP#ssl_version=]: ;TI"Sets the SSL version.;To;;0;[o; ;[I"/{#use_ssl=}[rdoc-ref:Net::HTTP#use_ssl=]: ;TI"CSets whether a new session is to use Transport Layer Security.;To;;0;[o; ;[I"/{#use_ssl?}[rdoc-ref:Net::HTTP#use_ssl?]: ;TI"%Returns whether +self+ uses SSL.;To;;0;[o; ;[I"={:verify_callback}[rdoc-ref:Net::HTTP#verify_callback]: ;TI"DReturns the callback for the server certification verification.;To;;0;[o; ;[I"?{:verify_callback=}[rdoc-ref:Net::HTTP#verify_callback=]: ;TI"ASets the callback for the server certification verification.;To;;0;[o; ;[I"7{:verify_depth}[rdoc-ref:Net::HTTP#verify_depth]: ;TI"FReturns the maximum depth for the certificate chain verification.;To;;0;[o; ;[I"9{:verify_depth=}[rdoc-ref:Net::HTTP#verify_depth=]: ;TI"CSets the maximum depth for the certificate chain verification.;To;;0;[o; ;[I"={:verify_hostname}[rdoc-ref:Net::HTTP#verify_hostname]: ;TI"iReturns the flags for server the certification verification at the beginning of the SSL/TLS session.;To;;0;[o; ;[I"?{:verify_hostname=}[rdoc-ref:Net::HTTP#verify_hostname=]: ;TI"eSets he flags for server the certification verification at the beginning of the SSL/TLS session.;To;;0;[o; ;[I"5{:verify_mode}[rdoc-ref:Net::HTTP#verify_mode]: ;TI"iReturns the flags for server the certification verification at the beginning of the SSL/TLS session.;To;;0;[o; ;[I"7{:verify_mode=}[rdoc-ref:Net::HTTP#verify_mode=]: ;TI"fSets the flags for server the certification verification at the beginning of the SSL/TLS session.;T@S;;i;I"Addresses and Ports;T@o;;;;[o;;0;[o; ;[I"-{:address}[rdoc-ref:Net::HTTP#address]: ;TI"-Returns the string host name or host IP.;To;;0;[o; ;[I"8{::default_port}[rdoc-ref:Net::HTTP.default_port]: ;TI"CReturns integer 80, the default port to use for HTTP requests.;To;;0;[o; ;[I"B{::http_default_port}[rdoc-ref:Net::HTTP.http_default_port]: ;TI"CReturns integer 80, the default port to use for HTTP requests.;To;;0;[o; ;[I"D{::https_default_port}[rdoc-ref:Net::HTTP.https_default_port]: ;TI"EReturns integer 443, the default port to use for HTTPS requests.;To;;0;[o; ;[I"+{#ipaddr}[rdoc-ref:Net::HTTP#ipaddr]: ;TI"/Returns the IP address for the connection.;To;;0;[o; ;[I"-{#ipaddr=}[rdoc-ref:Net::HTTP#ipaddr=]: ;TI",Sets the IP address for the connection.;To;;0;[o; ;[I"3{:local_host}[rdoc-ref:Net::HTTP#local_host]: ;TI"DReturns the string local host used to establish the connection.;To;;0;[o; ;[I"5{:local_host=}[rdoc-ref:Net::HTTP#local_host=]: ;TI"ASets the string local host used to establish the connection.;To;;0;[o; ;[I"3{:local_port}[rdoc-ref:Net::HTTP#local_port]: ;TI"EReturns the integer local port used to establish the connection.;To;;0;[o; ;[I"5{:local_port=}[rdoc-ref:Net::HTTP#local_port=]: ;TI"BSets the integer local port used to establish the connection.;To;;0;[o; ;[I"'{:port}[rdoc-ref:Net::HTTP#port]: ;TI"%Returns the integer port number.;T@S;;i;I"\HTTP Version;T@o;;;;[o;;0;[o; ;[I"7{::version_1_2?}[rdoc-ref:Net::HTTP.version_1_2?] ;TI"C(aliased as {::version_1_2}[rdoc-ref:Net::HTTP.version_1_2]): ;TI".Returns true; retained for compatibility.;T@S;;i;I"Debugging;T@o;;;;[o;;0;[o; ;[I"?{#set_debug_output}[rdoc-ref:Net::HTTP#set_debug_output]: ;TI"*Sets the output stream for debugging.;T; I"lib/net/http.rb;T; 0@�@cRDoc::NormalModule0U;[i I"HTTPMultipleChoice;TI"Net::HTTPMultipleChoice;T;I"Net::HTTPMultipleChoices;To;;[o; ;[I"NResponse class for <tt>Multiple Choices</tt> responses (status code 300).;T@o; ;[I"FThe <tt>Multiple Choices</tt> response indicates that the server ;TI"Ooffers multiple options for the resource from which the client may choose.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300].;To;;0;[o; ;[I"W{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-300-multiple-choices].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#300].;T; @; 0@@@�0U;[i I"HTTPMovedTemporarily;TI"Net::HTTPMovedTemporarily;T;I"Net::HTTPFound;To;;[o; ;[I"CResponse class for <tt>Found</tt> responses (status code 302).;T@o; ;[I";The <tt>Found</tt> response indicates that the client ;TI",should look at (browse to) another URL.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302].;To;;0;[o; ;[I"L{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-302-found].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#302].;T; @; 0@@@�0U;[i I"HTTPRequestTimeOut;TI"Net::HTTPRequestTimeOut;T;I"Net::HTTPRequestTimeout;To;;[o; ;[I"MResponse class for <tt>Request Timeout</tt> responses (status code 408).;T@o; ;[I"2The server timed out waiting for the request.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408].;To;;0;[o; ;[I"V{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-408-request-timeout].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#408].;T; @; 0@@@�0U;[i I"HTTPRequestEntityTooLarge;TI"#Net::HTTPRequestEntityTooLarge;T;I"Net::HTTPPayloadTooLarge;To;;[o; ;[I"OResponse class for <tt>Payload Too Large</tt> responses (status code 413).;T@o; ;[I"IThe request is larger than the server is willing or able to process.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413].;To;;0;[o; ;[I"X{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-413-content-too-large].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#413].;T; @; 0@@@�0U;[i I"HTTPRequestURITooLong;TI"Net::HTTPRequestURITooLong;T;I"Net::HTTPURITooLong;To;;[o; ;[I"JResponse class for <tt>URI Too Long</tt> responses (status code 414).;T@o; ;[I"=The URI provided was too long for the server to process.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414].;To;;0;[o; ;[I"S{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-414-uri-too-long].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#414].;T; @; 0@@@�0U;[i I"HTTPRequestURITooLarge;TI" Net::HTTPRequestURITooLarge;T;I"Net::HTTPRequestURITooLong;T@\@@@�0U;[i I"%HTTPRequestedRangeNotSatisfiable;TI"*Net::HTTPRequestedRangeNotSatisfiable;T;I"!Net::HTTPRangeNotSatisfiable;To;;[o; ;[I"SResponse class for <tt>Range Not Satisfiable</tt> responses (status code 416).;T@o; ;[I"WThe request entity has a media type which the server or resource does not support.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416].;To;;0;[o; ;[I"\{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-416-range-not-satisfiable].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#416].;T; @; 0@@@�0U;[i I"HTTPGatewayTimeOut;TI"Net::HTTPGatewayTimeOut;T;I"Net::HTTPGatewayTimeout;To;;[o; ;[I"MResponse class for <tt>Gateway Timeout</tt> responses (status code 504).;T@o; ;[I"1The server was acting as a gateway or proxy ;TI"Dand did not receive a timely response from the upstream server.;T@o; ;[I"CThis class also includes (indirectly) module Net::HTTPHeader, ;TI"which gives access to its ;TI"E{methods for getting headers}[rdoc-ref:Net::HTTPHeader@Getters].;T@o; ;[I"References:;T@o;;;;[o;;0;[o; ;[I"M{Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504].;To;;0;[o; ;[I"V{RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-504-gateway-timeout].;To;;0;[o; ;[I"N{Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#504].;T; @; 0@@@�0[ [[I" class;T[[;[ [:protected[ [:private[ [I" instance;T[[;[ [;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ; 0; 0[@�@I"$lib/net/http/generic_request.rb;TI"lib/net/http/header.rb;TI" lib/net/http/proxy_delta.rb;TI"lib/net/http/request.rb;TI"lib/net/http/requests.rb;TI"lib/net/http/response.rb;T@I"lib/net/http/status.rb;TI"lib/net/protocol.rb;TI"lib/open-uri.rb;TI"(lib/rubygems/gemcutter_utilities.rb;TI"Clib/rubygems/gemcutter_utilities/webauthn_listener/response.rb;TI"8lib/rubygems/gemcutter_utilities/webauthn_poller.rb;TI"#lib/rubygems/remote_fetcher.rb;TI"lib/rubygems/request.rb;TI"-lib/rubygems/request/connection_pools.rb;TI""lib/rubygems/s3_uri_signer.rb;TI"&lib/rubygems/vendored_net_http.rb;T@�cRDoc::TopLevel