D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Net
/
HTTP
/
Filename :
get-c.ri
back
Copy
U:RDoc::AnyMethod[iI"get:ETI"Net::HTTP::get;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"ISends a GET request and returns the \HTTP response body as a string.;To:RDoc::Markup::BlankLine o; ; [I"1With string arguments +hostname+ and +path+:;T@o:RDoc::Markup::Verbatim; [I"/hostname = 'jsonplaceholder.typicode.com' ;TI"path = '/todos/1' ;TI"(puts Net::HTTP.get(hostname, path) ;T:@format0o; ; [I"Output:;T@o;; [I"{ ;TI" "userId": 1, ;TI" "id": 1, ;TI"& "title": "delectus aut autem", ;TI" "completed": false ;TI"} ;T; 0o; ; [I"@With URI object +uri+ and optional hash argument +headers+:;T@o;; [I"?uri = URI('https://jsonplaceholder.typicode.com/todos/1') ;TI"Eheaders = {'Content-type' => 'application/json; charset=UTF-8'} ;TI"!Net::HTTP.get(uri, headers) ;T; 0o; ; [I" Related:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I":Net::HTTP::Get: request class for \HTTP method +GET+.;To;;0; [o; ; [I">Net::HTTP#get: convenience method for \HTTP method +GET+.;T: @fileI"lib/net/http.rb;T:0@omit_headings_from_table_of_contents_below0I"pNet::HTTP.get(hostname, path, port = 80) -> body Net::HTTP:get(uri, headers = {}, port = uri.port) -> body ;T0[ I"5(uri_or_host, path_or_headers = nil, port = nil);T@9FI" HTTP;TcRDoc::NormalClass00