D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Net
/
HTTP
/
Filename :
request_get-i.ri
back
Copy
U:RDoc::AnyMethod[iI"request_get:ETI"Net::HTTP#request_get;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"(Sends a GET request to the server; ;TI"8forms the response into a Net::HTTPResponse object.;To:RDoc::Markup::BlankLine o; ; [I"7The request is based on the Net::HTTP::Get object ;TI"Fcreated from string +path+ and initial headers hash +initheader+.;T@o; ; [I"6With no block given, returns the response object:;T@o:RDoc::Markup::Verbatim; [I"$http = Net::HTTP.new(hostname) ;TI"Ihttp.request_get('/todos') # => #<Net::HTTPOK 200 OK readbody=true> ;T:@format0o; ; [I"BWith a block given, calls the block with the response object ;TI"%and returns the response object:;T@o;; [I")http.request_get('/todos') do |res| ;TI" p res ;TI"2end # => #<Net::HTTPOK 200 OK readbody=true> ;T; 0o; ; [I"Output:;T@o;; [I")#<Net::HTTPOK 200 OK readbody=false>;T; 0: @fileI"lib/net/http.rb;T:0@omit_headings_from_table_of_contents_below00I" response;T[ I"(path, initheader = nil);T@*FI" HTTP;TcRDoc::NormalClass00