mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00

[ruby/net-http] Adding links to referencesb85530e6b8
--- lib/net/http/responses.rb | 206 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 180 insertions(+), 26 deletions(-) [ruby/net-http] [DOC] Adding links to references (https://github.com/ruby/net-http/pull/97)768115167a
--- lib/net/http/responses.rb | 83 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 72 insertions(+), 11 deletions(-) [ruby/net-http] Adding links to references1c8151aaf3
--- lib/net/http/responses.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) [ruby/net-http] Enhanced RDoc for HTTPHeader6a282eccdd
--- lib/net/http/header.rb | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for set_form (https://github.com/ruby/net-http/pull/103)f6506ff889
--- lib/net/http/header.rb | 152 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 102 insertions(+), 50 deletions(-) [ruby/net-http] [DOC] Header doc (https://github.com/ruby/net-http/pull/104)3308362d9b
--- lib/net/http/header.rb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) [ruby/net-http] Correct doc errordc006d8419
--- lib/net/http/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Manually merged https://github.com/ruby/net-http/pull/106 Co-authored-by: Peter Zhu <peter@peterzhu.ca> Co-authored-by: BurdetteLamar <burdettelamar@yahoo.com> --- lib/net/http.rb | 109 +++++++++++++++++++++++++++----------------------------- 1 file changed, 52 insertions(+), 57 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/110)b098caa5e4
--- doc/net-http/examples.rdoc | 3 +- lib/net/http.rb | 166 +++++++++++++++++++++------------------------ 2 files changed, 78 insertions(+), 91 deletions(-) [ruby/net-http] Redirection revision9a4e2d3a2a
--- lib/net/http.rb | 62 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for HTTPGenericRequest (https://github.com/ruby/net-http/pull/113)14c8405702
--- lib/net/http/generic_request.rb | 92 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 8 deletions(-) [ruby/net-http] Remarks on inclusionsdfd060c583
--- doc/net-http/included_getters.rdoc | 3 + doc/net-http/included_setters.rdoc | 3 + lib/net/http/requests.rb | 30 ++++++++++ lib/net/http/responses.rb | 120 +++++++++++++++++++++++++++++++++++++ 4 files changed, 156 insertions(+) create mode 100644 doc/net-http/included_getters.rdoc create mode 100644 doc/net-http/included_setters.rdoc [ruby/net-http] [DOC] Enhanced RDoc for write_timeout (https://github.com/ruby/net-http/pull/115)6da39b0461
--- lib/net/http.rb | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/116)22c0d34002
--- lib/net/http.rb | 78 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 19 deletions(-) * remove trailing spaces. [ci skip] --- lib/net/http.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) [ruby/net-http] [DOC] Reorganize doc for proxy server (https://github.com/ruby/net-http/pull/117)f8b6b76cba
--- lib/net/http.rb | 198 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 100 insertions(+), 98 deletions(-) [ruby/net-http] Enhanced RDoc for Net::HTTPe65a3d9f11
--- lib/net/http.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) [ruby/net-http] Enhanced RDoc for Compressioncff88acd70
--- lib/net/http.rb | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for request headers (https://github.com/ruby/net-http/pull/120)b4eb8a7932
--- doc/net-http/included_setters.rdoc | 3 --- lib/net/http/request.rb | 53 +++++++++++++++++++++++++++++++++++--- lib/net/http/requests.rb | 30 ++++++++++----------- 3 files changed, 64 insertions(+), 22 deletions(-) delete mode 100644 doc/net-http/included_setters.rdoc [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP#get (https://github.com/ruby/net-http/pull/121)51b9af1eed
--- lib/net/http.rb | 53 +++++++++++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 30 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/122)06f79cda87
--- lib/net/http.rb | 91 ++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 34 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/123)220ff3f741
--- lib/net/http.rb | 118 +++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 96 insertions(+), 22 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net:HTTP (https://github.com/ruby/net-http/pull/124)aaf26b21d6
--- lib/net/http.rb | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/125)2ea20380fc
--- lib/net/http.rb | 130 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 87 insertions(+), 43 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/126)4700d0660b
--- lib/net/http.rb | 87 +++++++++++++++++++++++++++++++------------------- lib/net/http/status.rb | 2 +- 2 files changed, 55 insertions(+), 34 deletions(-) [ruby/net-http] [DOC] Enhanced RDoc for Net::HTTP (https://github.com/ruby/net-http/pull/127)07b2b88ef5
--- lib/net/http.rb | 65 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 30 deletions(-)
31 lines
835 B
Text
31 lines
835 B
Text
Examples here assume that <tt>net/http</tt> has been required
|
|
(which also requires +uri+):
|
|
|
|
require 'net/http'
|
|
|
|
Many code examples here use these example websites:
|
|
|
|
- https://jsonplaceholder.typicode.com.
|
|
- http://example.com.
|
|
|
|
Some examples also assume these variables:
|
|
|
|
uri = URI('https://jsonplaceholder.typicode.com/')
|
|
uri.freeze # Examples may not modify.
|
|
hostname = uri.hostname # => "jsonplaceholder.typicode.com"
|
|
path = uri.path # => "/"
|
|
port = uri.port # => 443
|
|
|
|
So that example requests may be written as:
|
|
|
|
Net::HTTP.get(uri)
|
|
Net::HTTP.get(hostname, '/index.html')
|
|
Net::HTTP.start(hostname) do |http|
|
|
http.get('/todos/1')
|
|
http.get('/todos/2')
|
|
end
|
|
|
|
An example that needs a modified URI first duplicates +uri+, then modifies the duplicate:
|
|
|
|
_uri = uri.dup
|
|
_uri.path = '/todos/1'
|