net-http 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83d503ad3cfa67ad617fbfe5f168b22759f54eba460aceedba49245dd09d36d0
4
- data.tar.gz: 57ae006e8c77d3d1bac46a6693e6377ad38e0d690669b9f1a2a447926e2a626b
3
+ metadata.gz: d2201663415fa5809c53f6c1d8a06524739bcee246443e22175aa89cda45c92c
4
+ data.tar.gz: 971f571f8d9966a09baf43a5117d9f072ae78b890e6cc4991a958081728671c8
5
5
  SHA512:
6
- metadata.gz: 131cb53d9b3ae85db640cf78f1a43f660908cfd8f753cd41f5bea7179a92e5efd328e2f91fced1bc4e8cc69152ca9d95bc32544031cc79654c157f4573506a86
7
- data.tar.gz: 3753128576e206b26a75f2828b5502cfc341854273f385a0771a988dfa69a6482351767f607d4bee211dbdac94937980b69c10c57e1cf69df41147a31621f2ce
6
+ metadata.gz: '086e4def849a69d4ecad94e1a13fe35eee82453f8748be247ea2c133b40ae7d3b419a0f71fa9dcd7efe783d0b725a13d527e287da1ccc406f7daa5700f2ec8e5'
7
+ data.tar.gz: 47a0f2d46fe8a9bc328241fb0fc90ea1c4285b0e46460998e40650a930bd96743051911e62b790d4502b39a007a5a04e260affe42d584bb73442ab414b51f1e3
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
5
- /doc/
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
@@ -0,0 +1,30 @@
1
+ Examples here assume that <tt>net/http</tt> has been required
2
+ (which also requires +uri+):
3
+
4
+ require 'net/http'
5
+
6
+ Many code examples here use these example websites:
7
+
8
+ - https://jsonplaceholder.typicode.com.
9
+ - http://example.com.
10
+
11
+ Some examples also assume these variables:
12
+
13
+ uri = URI('https://jsonplaceholder.typicode.com')
14
+ uri.freeze # Examples may not modify.
15
+ hostname = uri.hostname # => "jsonplaceholder.typicode.com"
16
+ port = uri.port # => 443
17
+
18
+ So that example requests may be written as:
19
+
20
+ Net::HTTP.get(uri)
21
+ Net::HTTP.get(hostname, '/index.html')
22
+ Net::HTTP.start(hostname) do |http|
23
+ http.get('/todos/1')
24
+ http.get('/todos/2')
25
+ end
26
+
27
+ An example that needs a modified URI first duplicates +uri+, then modifies the duplicate:
28
+
29
+ _uri = uri.dup
30
+ _uri.path = '/todos/1'