ÿØÿà JFIF ÿÛ „ ( %!1!%)+//.383,7(-.+
-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ ¥2" ÿÄ ÿÄ J ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ ÿÄ * !1AQa‘"2q3±ð#b¡ÿÚ ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁTÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßwpŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
?>
.........................................
.............................................................................
ÿØÿà JFIF ÿÛ „
(
%!1!%)+//.383,7(-.+
-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ ¥2" ÿÄ
ÿÄ J ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ
ÿÄ * !1AQa‘"2q3±ð#b¡ÿÚ
? ¼QxJQaÍuò¸Zö
Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁTÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßwpŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
?>
.........................................
.............................................................................
????????????????????????????????????
????????????????????????????????????
ÿØÿà JFIF ÿÛ „ ( %!1!%)+//.383,7(-.+
-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ ¥2" ÿÄ ÿÄ J ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ ÿÄ * !1AQa‘"2q3±ð#b¡ÿÚ ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁTÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßwpŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
?>
.........................................
.............................................................................
ÿØÿà JFIF ÿÛ „
(
%!1!%)+//.383,7(-.+
-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ ¥2" ÿÄ
ÿÄ J ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ
ÿÄ * !1AQa‘"2q3±ð#b¡ÿÚ
? ¼QxJQaÍuò¸Zö
Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁTÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßwpŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
?>
.........................................
.............................................................................
????????????????????????????????????
????????????????????????????????????
U:RDoc::NormalClass[iI" HTTP:ETI"Net::HTTP;TI"
Protocol;To:RDoc::Markup::Document:@parts[o;;[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 net/http 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 'https' and 'http':;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" #
;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 # => #
;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 'http_proxy'.;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# => #
;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 'ENV['http_proxy']';T@o; ;[
I"5When environment variable 'http_proxy' ;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 'http' or 'https':;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 'Accept-Encoding' ;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 'Content-Range'.;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"@'deflate', 'gzip', or 'x-gzip': ;TI"2decompresses the body and deletes the header.;To;;0;[o; ;[I"-'none' or 'identity': ;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"Content-Length 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 Content-Length 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:
@fileI"lib/net/http.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[-[
I"default_configuration;TI"RW;T:publicTI"lib/net/http.rb;T[
I"proxy_address;TI"R;T;T@[
I"proxy_pass;T@;T@[
I"proxy_port;T@;T@[
I"proxy_use_ssl;T@;T@[
I"proxy_user;T@;T@[
I"address;T@;F@[
I"ca_file;T@;F@[
I"ca_path;T@;F@[
I" cert;T@;F@[
I"cert_store;T@;F@[
I"ciphers;T@;F@[
I"close_on_empty_response;T@;F@[
I"continue_timeout;T@;F@[
I"extra_chain_cert;T@;F@[
I"ignore_eof;T@;F@[
I"keep_alive_timeout;T@;F@[
I"key;T@;F@[
I"local_host;T@;F@[
I"local_port;T@;F@[
I"max_retries;T@;F@[
I"max_version;T@;F@[
I"min_version;T@;F@[
I"open_timeout;T@;F@[
I" port;T@;F@[
I"proxy_address;TI"W;T;F@[
I"proxy_from_env;T@;F@[
I"proxy_pass;T@;F@[
I"proxy_port;T@;F@[
I"proxy_use_ssl;T@;F@[
I"proxy_user;T@;F@[
I"read_timeout;T@;F@[
I"response_body_encoding;T@;F@[
I"ssl_timeout;T@;F@[
I"ssl_version;T@;F@[
I"verify_callback;T@;F@[
I"verify_depth;T@;F@[
I"verify_hostname;T@;F@[
I"verify_mode;T@;F@[
I"write_timeout;T@;F@[ [ [[I"
class;T[[;[[I"default_port;T@[I"get;T@[I"get_print;T@[I"get_response;T@[I"http_default_port;T@[I"https_default_port;T@[I"new;T@[I" post;T@[I"post_form;T@[I"proxy_class?;T@[I"put;T@[I"
start;T@[I"version_1_2;T@[I"version_1_2?;T@[:protected[ [:private[ [I"
instance;T[[;[.[I"continue_timeout=;T@[I" copy;T@[I"delete;T@[I"finish;T@[I"get;T@[I" head;T@[I"inspect;T@[I"ipaddr;T@[I"ipaddr=;T@[I" lock;T@[I"max_retries=;T@[I"
mkcol;T@[I" move;T@[I"options;T@[I"
patch;T@[I"peer_cert;T@[I" post;T@[I"
propfind;T@[I"proppatch;T@[I"proxy?;T@[I"proxy_address;T@[I"proxy_from_env?;T@[I"proxy_pass;T@[I"proxy_port;T@[I"proxy_user;T@[I"put;T@[I"read_timeout=;T@[I"request;T@[I"request_get;T@[I"request_head;T@[I"request_post;T@[I"response_body_encoding=;T@[I"send_request;T@[I"set_debug_output;T@[I"
start;T@[I"
started?;T@[I"
trace;T@[I"unlock;T@[I"
use_ssl=;T@[I"
use_ssl?;T@[I"write_timeout=;T@[;[ [;[[I"D;T@[I"addr_port;T@[I"begin_transport;T@[I"connect;T@[I"
debug;T@[I"do_finish;T@[I"
do_start;T@[I"edit_path;T@[I"end_transport;T@[I"keep_alive?;T@[I"on_connect;T@[I"send_entity;T@[I"sspi_auth;T@[I"sspi_auth?;T@[I"transport_request;T@[I"
unescape;T@[ [U:RDoc::Context::Section[i 0o;;[ ;0;0[
@I"$lib/net/http/generic_request.rb;TI" lib/net/http/proxy_delta.rb;TI"lib/net/http/requests.rb;TI"lib/net/http/status.rb;TI"lib/open-uri.rb;TI"#lib/rubygems/remote_fetcher.rb;TI""lib/rubygems/s3_uri_signer.rb;TI"Net;TcRDoc::NormalModule