D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Net
/
HTTP
/
Filename :
request_post-i.ri
back
Copy
U:RDoc::AnyMethod[iI"request_post:ETI"Net::HTTP#request_post;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I")Sends a POST request to the server; ;TI"8forms the response into a Net::HTTPResponse object.;To:RDoc::Markup::BlankLine o; ; [I"8The request is based on the Net::HTTP::Post object ;TI"Vcreated from string +path+, string +data+, 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""http.post('/todos', 'xyzzy') ;TI"8# => #<Net::HTTPCreated 201 Created readbody=true> ;T:@format0o; ; [I"@With a block given, calls the block with the response body ;TI"%and returns the response object:;T@o;; [I"+http.post('/todos', 'xyzzy') do |res| ;TI" p res ;TI"<end # => #<Net::HTTPCreated 201 Created readbody=true> ;T; 0o; ; [I"Output:;T@o;; [I"."{\n \"xyzzy\": \"\",\n \"id\": 201\n}";T; 0: @fileI"lib/net/http.rb;T:0@omit_headings_from_table_of_contents_below00I" response;T[ I"#(path, data, initheader = nil);T@+FI" HTTP;TcRDoc::NormalClass00