e621_export_downloader 0.0.1

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.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.irbrc +14 -0
  3. data/.ruby-version +1 -0
  4. data/LICENSE +21 -0
  5. data/README.md +148 -0
  6. data/Rakefile +8 -0
  7. data/exe/e621-export-downloader +112 -0
  8. data/lib/e621_export_downloader/client/options/builder/parsers.rb +42 -0
  9. data/lib/e621_export_downloader/client/options/builder.rb +44 -0
  10. data/lib/e621_export_downloader/client/options.rb +37 -0
  11. data/lib/e621_export_downloader/client.rb +120 -0
  12. data/lib/e621_export_downloader/constants.rb +17 -0
  13. data/lib/e621_export_downloader/export.rb +128 -0
  14. data/lib/e621_export_downloader/export_helper.rb +83 -0
  15. data/lib/e621_export_downloader/models/pool.rb +69 -0
  16. data/lib/e621_export_downloader/models/post.rb +166 -0
  17. data/lib/e621_export_downloader/models/tag.rb +41 -0
  18. data/lib/e621_export_downloader/models/tag_alias.rb +46 -0
  19. data/lib/e621_export_downloader/models/tag_implication.rb +46 -0
  20. data/lib/e621_export_downloader/models/wiki_page.rb +61 -0
  21. data/lib/e621_export_downloader/types.rb +14 -0
  22. data/lib/e621_export_downloader/version.rb +10 -0
  23. data/lib/e621_export_downloader.rb +12 -0
  24. data/sorbet/config +5 -0
  25. data/sorbet/rbi/annotations/.gitattributes +1 -0
  26. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  27. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  28. data/sorbet/rbi/gems/.gitattributes +1 -0
  29. data/sorbet/rbi/gems/ast@2.4.3.rbi +550 -0
  30. data/sorbet/rbi/gems/benchmark@0.5.0.rbi +621 -0
  31. data/sorbet/rbi/gems/csv@3.3.5.rbi +4462 -0
  32. data/sorbet/rbi/gems/date@3.5.1.rbi +391 -0
  33. data/sorbet/rbi/gems/erb@6.0.4.rbi +1538 -0
  34. data/sorbet/rbi/gems/erubi@1.13.1.rbi +155 -0
  35. data/sorbet/rbi/gems/faraday-net_http@3.4.2.rbi +9 -0
  36. data/sorbet/rbi/gems/faraday@2.14.1.rbi +9 -0
  37. data/sorbet/rbi/gems/io-console@0.8.2.rbi +9 -0
  38. data/sorbet/rbi/gems/json@2.19.5.rbi +2240 -0
  39. data/sorbet/rbi/gems/language_server-protocol@3.17.0.5.rbi +9 -0
  40. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +189 -0
  41. data/sorbet/rbi/gems/logger@1.7.0.rbi +896 -0
  42. data/sorbet/rbi/gems/net-http@0.9.1.rbi +4029 -0
  43. data/sorbet/rbi/gems/netrc@0.11.0.rbi +147 -0
  44. data/sorbet/rbi/gems/parallel@2.1.0.rbi +321 -0
  45. data/sorbet/rbi/gems/parser@3.3.11.1.rbi +5229 -0
  46. data/sorbet/rbi/gems/pp@0.6.3.rbi +377 -0
  47. data/sorbet/rbi/gems/prettyprint@0.2.0.rbi +455 -0
  48. data/sorbet/rbi/gems/prism@1.9.0.rbi +42224 -0
  49. data/sorbet/rbi/gems/psych@5.3.1.rbi +2374 -0
  50. data/sorbet/rbi/gems/racc@1.8.1.rbi +165 -0
  51. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +362 -0
  52. data/sorbet/rbi/gems/rake@13.4.2.rbi +3130 -0
  53. data/sorbet/rbi/gems/rbi@0.3.11.rbi +5505 -0
  54. data/sorbet/rbi/gems/rbs@4.0.2.rbi +6908 -0
  55. data/sorbet/rbi/gems/rdoc@7.2.0.rbi +9 -0
  56. data/sorbet/rbi/gems/regexp_parser@2.12.0.rbi +3398 -0
  57. data/sorbet/rbi/gems/reline@0.6.3.rbi +2446 -0
  58. data/sorbet/rbi/gems/require-hooks@0.4.0.rbi +152 -0
  59. data/sorbet/rbi/gems/rexml@3.4.4.rbi +4905 -0
  60. data/sorbet/rbi/gems/rubocop-ast@1.49.1.rbi +7062 -0
  61. data/sorbet/rbi/gems/rubocop-rake@0.7.1.rbi +314 -0
  62. data/sorbet/rbi/gems/rubocop@1.86.1.rbi +62227 -0
  63. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +988 -0
  64. data/sorbet/rbi/gems/rubydex@0.2.0.rbi +663 -0
  65. data/sorbet/rbi/gems/spoom@1.7.13.rbi +6151 -0
  66. data/sorbet/rbi/gems/stringio@3.2.0.rbi +9 -0
  67. data/sorbet/rbi/gems/tapioca@0.19.1.rbi +3555 -0
  68. data/sorbet/rbi/gems/thor@1.5.0.rbi +3870 -0
  69. data/sorbet/rbi/gems/tsort@0.2.0.rbi +389 -0
  70. data/sorbet/rbi/gems/unicode-display_width@3.2.0.rbi +130 -0
  71. data/sorbet/rbi/gems/unicode-emoji@4.2.0.rbi +332 -0
  72. data/sorbet/rbi/gems/uri@1.1.1.rbi +2400 -0
  73. data/sorbet/rbi/gems/zeitwerk@2.7.5.rbi +1090 -0
  74. data/sorbet/rbi/shims/faraday.rbi +42 -0
  75. data/sorbet/rbi/todo.rbi +7 -0
  76. data/sorbet/tapioca/config.yml +13 -0
  77. data/sorbet/tapioca/require.rb +4 -0
  78. metadata +177 -0
@@ -0,0 +1,4029 @@
1
+ # typed: false
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `net-http` gem.
5
+ # Please instead update this file by running `bin/tapioca gem net-http`.
6
+
7
+
8
+ # \Class \Net::HTTP provides a rich library that implements the client
9
+ # in a client-server model that uses the \HTTP request-response protocol.
10
+ # For information about \HTTP, see:
11
+ #
12
+ # - {Hypertext Transfer Protocol}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol].
13
+ # - {Technical overview}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Technical_overview].
14
+ #
15
+ # == About the Examples
16
+ #
17
+ # :include: doc/net-http/examples.rdoc
18
+ #
19
+ # == Strategies
20
+ #
21
+ # - If you will make only a few GET requests,
22
+ # consider using {OpenURI}[https://docs.ruby-lang.org/en/master/OpenURI.html].
23
+ # - If you will make only a few requests of all kinds,
24
+ # consider using the various singleton convenience methods in this class.
25
+ # Each of the following methods automatically starts and finishes
26
+ # a {session}[rdoc-ref:Net::HTTP@Sessions] that sends a single request:
27
+ #
28
+ # # Return string response body.
29
+ # Net::HTTP.get(hostname, path)
30
+ # Net::HTTP.get(uri)
31
+ #
32
+ # # Write string response body to $stdout.
33
+ # Net::HTTP.get_print(hostname, path)
34
+ # Net::HTTP.get_print(uri)
35
+ #
36
+ # # Return response as Net::HTTPResponse object.
37
+ # Net::HTTP.get_response(hostname, path)
38
+ # Net::HTTP.get_response(uri)
39
+ # data = '{"title": "foo", "body": "bar", "userId": 1}'
40
+ # Net::HTTP.post(uri, data)
41
+ # params = {title: 'foo', body: 'bar', userId: 1}
42
+ # Net::HTTP.post_form(uri, params)
43
+ # data = '{"title": "foo", "body": "bar", "userId": 1}'
44
+ # Net::HTTP.put(uri, data)
45
+ #
46
+ # - If performance is important, consider using sessions, which lower request overhead.
47
+ # This {session}[rdoc-ref:Net::HTTP@Sessions] has multiple requests for
48
+ # {HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods]
49
+ # and {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]:
50
+ #
51
+ # Net::HTTP.start(hostname) do |http|
52
+ # # Session started automatically before block execution.
53
+ # http.get(path)
54
+ # http.head(path)
55
+ # body = 'Some text'
56
+ # http.post(path, body) # Can also have a block.
57
+ # http.put(path, body)
58
+ # http.delete(path)
59
+ # http.options(path)
60
+ # http.trace(path)
61
+ # http.patch(path, body) # Can also have a block.
62
+ # http.copy(path)
63
+ # http.lock(path, body)
64
+ # http.mkcol(path, body)
65
+ # http.move(path)
66
+ # http.propfind(path, body)
67
+ # http.proppatch(path, body)
68
+ # http.unlock(path, body)
69
+ # # Session finished automatically at block exit.
70
+ # end
71
+ #
72
+ # The methods cited above are convenience methods that, via their few arguments,
73
+ # allow minimal control over the requests.
74
+ # For greater control, consider using {request objects}[rdoc-ref:Net::HTTPRequest].
75
+ #
76
+ # == URIs
77
+ #
78
+ # On the internet, a URI
79
+ # ({Universal Resource Identifier}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier])
80
+ # is a string that identifies a particular resource.
81
+ # It consists of some or all of: scheme, hostname, path, query, and fragment;
82
+ # see {URI syntax}[https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Syntax].
83
+ #
84
+ # A Ruby {URI::Generic}[https://docs.ruby-lang.org/en/master/URI/Generic.html] object
85
+ # represents an internet URI.
86
+ # It provides, among others, methods
87
+ # +scheme+, +hostname+, +path+, +query+, and +fragment+.
88
+ #
89
+ # === Schemes
90
+ #
91
+ # An internet \URI has
92
+ # a {scheme}[https://en.wikipedia.org/wiki/List_of_URI_schemes].
93
+ #
94
+ # The two schemes supported in \Net::HTTP are <tt>'https'</tt> and <tt>'http'</tt>:
95
+ #
96
+ # uri.scheme # => "https"
97
+ # URI('http://example.com').scheme # => "http"
98
+ #
99
+ # === Hostnames
100
+ #
101
+ # A hostname identifies a server (host) to which requests may be sent:
102
+ #
103
+ # hostname = uri.hostname # => "jsonplaceholder.typicode.com"
104
+ # Net::HTTP.start(hostname) do |http|
105
+ # # Some HTTP stuff.
106
+ # end
107
+ #
108
+ # === Paths
109
+ #
110
+ # A host-specific path identifies a resource on the host:
111
+ #
112
+ # _uri = uri.dup
113
+ # _uri.path = '/todos/1'
114
+ # hostname = _uri.hostname
115
+ # path = _uri.path
116
+ # Net::HTTP.get(hostname, path)
117
+ #
118
+ # === Queries
119
+ #
120
+ # A host-specific query adds name/value pairs to the URI:
121
+ #
122
+ # _uri = uri.dup
123
+ # params = {userId: 1, completed: false}
124
+ # _uri.query = URI.encode_www_form(params)
125
+ # _uri # => #<URI::HTTPS https://jsonplaceholder.typicode.com?userId=1&completed=false>
126
+ # Net::HTTP.get(_uri)
127
+ #
128
+ # === Fragments
129
+ #
130
+ # A {URI fragment}[https://en.wikipedia.org/wiki/URI_fragment] has no effect
131
+ # in \Net::HTTP;
132
+ # the same data is returned, regardless of whether a fragment is included.
133
+ #
134
+ # == Request Headers
135
+ #
136
+ # Request headers may be used to pass additional information to the host,
137
+ # similar to arguments passed in a method call;
138
+ # each header is a name/value pair.
139
+ #
140
+ # Each of the \Net::HTTP methods that sends a request to the host
141
+ # has optional argument +headers+,
142
+ # where the headers are expressed as a hash of field-name/value pairs:
143
+ #
144
+ # headers = {Accept: 'application/json', Connection: 'Keep-Alive'}
145
+ # Net::HTTP.get(uri, headers)
146
+ #
147
+ # See lists of both standard request fields and common request fields at
148
+ # {Request Fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields].
149
+ # A host may also accept other custom fields.
150
+ #
151
+ # == \HTTP Sessions
152
+ #
153
+ # A _session_ is a connection between a server (host) and a client that:
154
+ #
155
+ # - Is begun by instance method Net::HTTP#start.
156
+ # - May contain any number of requests.
157
+ # - Is ended by instance method Net::HTTP#finish.
158
+ #
159
+ # See example sessions at {Strategies}[rdoc-ref:Net::HTTP@Strategies].
160
+ #
161
+ # === Session Using \Net::HTTP.start
162
+ #
163
+ # If you have many requests to make to a single host (and port),
164
+ # consider using singleton method Net::HTTP.start with a block;
165
+ # the method handles the session automatically by:
166
+ #
167
+ # - Calling #start before block execution.
168
+ # - Executing the block.
169
+ # - Calling #finish after block execution.
170
+ #
171
+ # In the block, you can use these instance methods,
172
+ # each of which that sends a single request:
173
+ #
174
+ # - {HTTP methods}[https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods]:
175
+ #
176
+ # - #get, #request_get: GET.
177
+ # - #head, #request_head: HEAD.
178
+ # - #post, #request_post: POST.
179
+ # - #delete: DELETE.
180
+ # - #options: OPTIONS.
181
+ # - #trace: TRACE.
182
+ # - #patch: PATCH.
183
+ #
184
+ # - {WebDAV methods}[https://en.wikipedia.org/wiki/WebDAV#Implementation]:
185
+ #
186
+ # - #copy: COPY.
187
+ # - #lock: LOCK.
188
+ # - #mkcol: MKCOL.
189
+ # - #move: MOVE.
190
+ # - #propfind: PROPFIND.
191
+ # - #proppatch: PROPPATCH.
192
+ # - #unlock: UNLOCK.
193
+ #
194
+ # === Session Using \Net::HTTP.start and \Net::HTTP.finish
195
+ #
196
+ # You can manage a session manually using methods #start and #finish:
197
+ #
198
+ # http = Net::HTTP.new(hostname)
199
+ # http.start
200
+ # http.get('/todos/1')
201
+ # http.get('/todos/2')
202
+ # http.delete('/posts/1')
203
+ # http.finish # Needed to free resources.
204
+ #
205
+ # === Single-Request Session
206
+ #
207
+ # Certain convenience methods automatically handle a session by:
208
+ #
209
+ # - Creating an \HTTP object
210
+ # - Starting a session.
211
+ # - Sending a single request.
212
+ # - Finishing the session.
213
+ # - Destroying the object.
214
+ #
215
+ # Such methods that send GET requests:
216
+ #
217
+ # - ::get: Returns the string response body.
218
+ # - ::get_print: Writes the string response body to $stdout.
219
+ # - ::get_response: Returns a Net::HTTPResponse object.
220
+ #
221
+ # Such methods that send POST requests:
222
+ #
223
+ # - ::post: Posts data to the host.
224
+ # - ::post_form: Posts form data to the host.
225
+ #
226
+ # == \HTTP Requests and Responses
227
+ #
228
+ # Many of the methods above are convenience methods,
229
+ # each of which sends a request and returns a string
230
+ # without directly using \Net::HTTPRequest and \Net::HTTPResponse objects.
231
+ #
232
+ # You can, however, directly create a request object, send the request,
233
+ # and retrieve the response object; see:
234
+ #
235
+ # - Net::HTTPRequest.
236
+ # - Net::HTTPResponse.
237
+ #
238
+ # == Following Redirection
239
+ #
240
+ # Each returned response is an instance of a subclass of Net::HTTPResponse.
241
+ # See the {response class hierarchy}[rdoc-ref:Net::HTTPResponse@Response+Subclasses].
242
+ #
243
+ # In particular, class Net::HTTPRedirection is the parent
244
+ # of all redirection classes.
245
+ # This allows you to craft a case statement to handle redirections properly:
246
+ #
247
+ # def fetch(uri, limit = 10)
248
+ # # You should choose a better exception.
249
+ # raise ArgumentError, 'Too many HTTP redirects' if limit == 0
250
+ #
251
+ # res = Net::HTTP.get_response(URI(uri))
252
+ # case res
253
+ # when Net::HTTPSuccess # Any success class.
254
+ # res
255
+ # when Net::HTTPRedirection # Any redirection class.
256
+ # location = res['Location']
257
+ # warn "Redirected to #{location}"
258
+ # fetch(location, limit - 1)
259
+ # else # Any other class.
260
+ # res.value
261
+ # end
262
+ # end
263
+ #
264
+ # fetch(uri)
265
+ #
266
+ # == Basic Authentication
267
+ #
268
+ # Basic authentication is performed according to
269
+ # {RFC2617}[http://www.ietf.org/rfc/rfc2617.txt]:
270
+ #
271
+ # req = Net::HTTP::Get.new(uri)
272
+ # req.basic_auth('user', 'pass')
273
+ # res = Net::HTTP.start(hostname) do |http|
274
+ # http.request(req)
275
+ # end
276
+ #
277
+ # == Streaming Response Bodies
278
+ #
279
+ # By default \Net::HTTP reads an entire response into memory. If you are
280
+ # handling large files or wish to implement a progress bar you can instead
281
+ # stream the body directly to an IO.
282
+ #
283
+ # Net::HTTP.start(hostname) do |http|
284
+ # req = Net::HTTP::Get.new(uri)
285
+ # http.request(req) do |res|
286
+ # open('t.tmp', 'w') do |f|
287
+ # res.read_body do |chunk|
288
+ # f.write chunk
289
+ # end
290
+ # end
291
+ # end
292
+ # end
293
+ #
294
+ # == HTTPS
295
+ #
296
+ # HTTPS is enabled for an \HTTP connection by Net::HTTP#use_ssl=:
297
+ #
298
+ # Net::HTTP.start(hostname, :use_ssl => true) do |http|
299
+ # req = Net::HTTP::Get.new(uri)
300
+ # res = http.request(req)
301
+ # end
302
+ #
303
+ # Or if you simply want to make a GET request, you may pass in a URI
304
+ # object that has an \HTTPS URL. \Net::HTTP automatically turns on TLS
305
+ # verification if the URI object has a 'https' URI scheme:
306
+ #
307
+ # uri # => #<URI::HTTPS https://jsonplaceholder.typicode.com/>
308
+ # Net::HTTP.get(uri)
309
+ #
310
+ # == Proxy Server
311
+ #
312
+ # An \HTTP object can have
313
+ # a {proxy server}[https://en.wikipedia.org/wiki/Proxy_server].
314
+ #
315
+ # You can create an \HTTP object with a proxy server
316
+ # using method Net::HTTP.new or method Net::HTTP.start.
317
+ #
318
+ # The proxy may be defined either by argument +p_addr+
319
+ # or by environment variable <tt>'http_proxy'</tt>.
320
+ #
321
+ # === Proxy Using Argument +p_addr+ as a \String
322
+ #
323
+ # When argument +p_addr+ is a string hostname,
324
+ # the returned +http+ has the given host as its proxy:
325
+ #
326
+ # http = Net::HTTP.new(hostname, nil, 'proxy.example')
327
+ # http.proxy? # => true
328
+ # http.proxy_from_env? # => false
329
+ # http.proxy_address # => "proxy.example"
330
+ # # These use default values.
331
+ # http.proxy_port # => 80
332
+ # http.proxy_user # => nil
333
+ # http.proxy_pass # => nil
334
+ #
335
+ # The port, username, and password for the proxy may also be given:
336
+ #
337
+ # http = Net::HTTP.new(hostname, nil, 'proxy.example', 8000, 'pname', 'ppass')
338
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
339
+ # http.proxy? # => true
340
+ # http.proxy_from_env? # => false
341
+ # http.proxy_address # => "proxy.example"
342
+ # http.proxy_port # => 8000
343
+ # http.proxy_user # => "pname"
344
+ # http.proxy_pass # => "ppass"
345
+ #
346
+ # === Proxy Using '<tt>ENV['http_proxy']</tt>'
347
+ #
348
+ # When environment variable <tt>'http_proxy'</tt>
349
+ # is set to a \URI string,
350
+ # the returned +http+ will have the server at that URI as its proxy;
351
+ # note that the \URI string must have a protocol
352
+ # such as <tt>'http'</tt> or <tt>'https'</tt>:
353
+ #
354
+ # ENV['http_proxy'] = 'http://example.com'
355
+ # http = Net::HTTP.new(hostname)
356
+ # http.proxy? # => true
357
+ # http.proxy_from_env? # => true
358
+ # http.proxy_address # => "example.com"
359
+ # # These use default values.
360
+ # http.proxy_port # => 80
361
+ # http.proxy_user # => nil
362
+ # http.proxy_pass # => nil
363
+ #
364
+ # The \URI string may include proxy username, password, and port number:
365
+ #
366
+ # ENV['http_proxy'] = 'http://pname:ppass@example.com:8000'
367
+ # http = Net::HTTP.new(hostname)
368
+ # http.proxy? # => true
369
+ # http.proxy_from_env? # => true
370
+ # http.proxy_address # => "example.com"
371
+ # http.proxy_port # => 8000
372
+ # http.proxy_user # => "pname"
373
+ # http.proxy_pass # => "ppass"
374
+ #
375
+ # === Filtering Proxies
376
+ #
377
+ # With method Net::HTTP.new (but not Net::HTTP.start),
378
+ # you can use argument +p_no_proxy+ to filter proxies:
379
+ #
380
+ # - Reject a certain address:
381
+ #
382
+ # http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example')
383
+ # http.proxy_address # => nil
384
+ #
385
+ # - Reject certain domains or subdomains:
386
+ #
387
+ # http = Net::HTTP.new('example.com', nil, 'my.proxy.example', 8000, 'pname', 'ppass', 'proxy.example')
388
+ # http.proxy_address # => nil
389
+ #
390
+ # - Reject certain addresses and port combinations:
391
+ #
392
+ # http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:1234')
393
+ # http.proxy_address # => "proxy.example"
394
+ #
395
+ # http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'proxy.example:8000')
396
+ # http.proxy_address # => nil
397
+ #
398
+ # - Reject a list of the types above delimited using a comma:
399
+ #
400
+ # http = Net::HTTP.new('example.com', nil, 'proxy.example', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000')
401
+ # http.proxy_address # => nil
402
+ #
403
+ # http = Net::HTTP.new('example.com', nil, 'my.proxy', 8000, 'pname', 'ppass', 'my.proxy,proxy.example:8000')
404
+ # http.proxy_address # => nil
405
+ #
406
+ # == Compression and Decompression
407
+ #
408
+ # \Net::HTTP does not compress the body of a request before sending.
409
+ #
410
+ # By default, \Net::HTTP adds header <tt>'Accept-Encoding'</tt>
411
+ # to a new {request object}[rdoc-ref:Net::HTTPRequest]:
412
+ #
413
+ # Net::HTTP::Get.new(uri)['Accept-Encoding']
414
+ # # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
415
+ #
416
+ # This requests the server to zip-encode the response body if there is one;
417
+ # the server is not required to do so.
418
+ #
419
+ # \Net::HTTP does not automatically decompress a response body
420
+ # if the response has header <tt>'Content-Range'</tt>.
421
+ #
422
+ # Otherwise decompression (or not) depends on the value of header
423
+ # {Content-Encoding}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-encoding-response-header]:
424
+ #
425
+ # - <tt>'deflate'</tt>, <tt>'gzip'</tt>, or <tt>'x-gzip'</tt>:
426
+ # decompresses the body and deletes the header.
427
+ # - <tt>'none'</tt> or <tt>'identity'</tt>:
428
+ # does not decompress the body, but deletes the header.
429
+ # - Any other value:
430
+ # leaves the body and header unchanged.
431
+ #
432
+ # == What's Here
433
+ #
434
+ # First, what's elsewhere. Class Net::HTTP:
435
+ #
436
+ # - Inherits from {class Object}[https://docs.ruby-lang.org/en/master/Object.html#class-Object-label-What-27s+Here].
437
+ #
438
+ # This is a categorized summary of methods and attributes.
439
+ #
440
+ # === \Net::HTTP Objects
441
+ #
442
+ # - {::new}[rdoc-ref:Net::HTTP.new]:
443
+ # Creates a new instance.
444
+ # - {#inspect}[rdoc-ref:Net::HTTP#inspect]:
445
+ # Returns a string representation of +self+.
446
+ #
447
+ # === Sessions
448
+ #
449
+ # - {::start}[rdoc-ref:Net::HTTP.start]:
450
+ # Begins a new session in a new \Net::HTTP object.
451
+ # - {#started?}[rdoc-ref:Net::HTTP#started?]:
452
+ # Returns whether in a session.
453
+ # - {#finish}[rdoc-ref:Net::HTTP#finish]:
454
+ # Ends an active session.
455
+ # - {#start}[rdoc-ref:Net::HTTP#start]:
456
+ # Begins a new session in an existing \Net::HTTP object (+self+).
457
+ #
458
+ # === Connections
459
+ #
460
+ # - {:continue_timeout}[rdoc-ref:Net::HTTP#continue_timeout]:
461
+ # Returns the continue timeout.
462
+ # - {#continue_timeout=}[rdoc-ref:Net::HTTP#continue_timeout=]:
463
+ # Sets the continue timeout seconds.
464
+ # - {:keep_alive_timeout}[rdoc-ref:Net::HTTP#keep_alive_timeout]:
465
+ # Returns the keep-alive timeout.
466
+ # - {:keep_alive_timeout=}[rdoc-ref:Net::HTTP#keep_alive_timeout=]:
467
+ # Sets the keep-alive timeout.
468
+ # - {:max_retries}[rdoc-ref:Net::HTTP#max_retries]:
469
+ # Returns the maximum retries.
470
+ # - {#max_retries=}[rdoc-ref:Net::HTTP#max_retries=]:
471
+ # Sets the maximum retries.
472
+ # - {:open_timeout}[rdoc-ref:Net::HTTP#open_timeout]:
473
+ # Returns the open timeout.
474
+ # - {:open_timeout=}[rdoc-ref:Net::HTTP#open_timeout=]:
475
+ # Sets the open timeout.
476
+ # - {:read_timeout}[rdoc-ref:Net::HTTP#read_timeout]:
477
+ # Returns the open timeout.
478
+ # - {:read_timeout=}[rdoc-ref:Net::HTTP#read_timeout=]:
479
+ # Sets the read timeout.
480
+ # - {:ssl_timeout}[rdoc-ref:Net::HTTP#ssl_timeout]:
481
+ # Returns the ssl timeout.
482
+ # - {:ssl_timeout=}[rdoc-ref:Net::HTTP#ssl_timeout=]:
483
+ # Sets the ssl timeout.
484
+ # - {:write_timeout}[rdoc-ref:Net::HTTP#write_timeout]:
485
+ # Returns the write timeout.
486
+ # - {write_timeout=}[rdoc-ref:Net::HTTP#write_timeout=]:
487
+ # Sets the write timeout.
488
+ #
489
+ # === Requests
490
+ #
491
+ # - {::get}[rdoc-ref:Net::HTTP.get]:
492
+ # Sends a GET request and returns the string response body.
493
+ # - {::get_print}[rdoc-ref:Net::HTTP.get_print]:
494
+ # Sends a GET request and write the string response body to $stdout.
495
+ # - {::get_response}[rdoc-ref:Net::HTTP.get_response]:
496
+ # Sends a GET request and returns a response object.
497
+ # - {::post_form}[rdoc-ref:Net::HTTP.post_form]:
498
+ # Sends a POST request with form data and returns a response object.
499
+ # - {::post}[rdoc-ref:Net::HTTP.post]:
500
+ # Sends a POST request with data and returns a response object.
501
+ # - {::put}[rdoc-ref:Net::HTTP.put]:
502
+ # Sends a PUT request with data and returns a response object.
503
+ # - {#copy}[rdoc-ref:Net::HTTP#copy]:
504
+ # Sends a COPY request and returns a response object.
505
+ # - {#delete}[rdoc-ref:Net::HTTP#delete]:
506
+ # Sends a DELETE request and returns a response object.
507
+ # - {#get}[rdoc-ref:Net::HTTP#get]:
508
+ # Sends a GET request and returns a response object.
509
+ # - {#head}[rdoc-ref:Net::HTTP#head]:
510
+ # Sends a HEAD request and returns a response object.
511
+ # - {#lock}[rdoc-ref:Net::HTTP#lock]:
512
+ # Sends a LOCK request and returns a response object.
513
+ # - {#mkcol}[rdoc-ref:Net::HTTP#mkcol]:
514
+ # Sends a MKCOL request and returns a response object.
515
+ # - {#move}[rdoc-ref:Net::HTTP#move]:
516
+ # Sends a MOVE request and returns a response object.
517
+ # - {#options}[rdoc-ref:Net::HTTP#options]:
518
+ # Sends a OPTIONS request and returns a response object.
519
+ # - {#patch}[rdoc-ref:Net::HTTP#patch]:
520
+ # Sends a PATCH request and returns a response object.
521
+ # - {#post}[rdoc-ref:Net::HTTP#post]:
522
+ # Sends a POST request and returns a response object.
523
+ # - {#propfind}[rdoc-ref:Net::HTTP#propfind]:
524
+ # Sends a PROPFIND request and returns a response object.
525
+ # - {#proppatch}[rdoc-ref:Net::HTTP#proppatch]:
526
+ # Sends a PROPPATCH request and returns a response object.
527
+ # - {#put}[rdoc-ref:Net::HTTP#put]:
528
+ # Sends a PUT request and returns a response object.
529
+ # - {#request}[rdoc-ref:Net::HTTP#request]:
530
+ # Sends a request and returns a response object.
531
+ # - {#request_get}[rdoc-ref:Net::HTTP#request_get]:
532
+ # Sends a GET request and forms a response object;
533
+ # if a block given, calls the block with the object,
534
+ # otherwise returns the object.
535
+ # - {#request_head}[rdoc-ref:Net::HTTP#request_head]:
536
+ # Sends a HEAD request and forms a response object;
537
+ # if a block given, calls the block with the object,
538
+ # otherwise returns the object.
539
+ # - {#request_post}[rdoc-ref:Net::HTTP#request_post]:
540
+ # Sends a POST request and forms a response object;
541
+ # if a block given, calls the block with the object,
542
+ # otherwise returns the object.
543
+ # - {#send_request}[rdoc-ref:Net::HTTP#send_request]:
544
+ # Sends a request and returns a response object.
545
+ # - {#trace}[rdoc-ref:Net::HTTP#trace]:
546
+ # Sends a TRACE request and returns a response object.
547
+ # - {#unlock}[rdoc-ref:Net::HTTP#unlock]:
548
+ # Sends an UNLOCK request and returns a response object.
549
+ #
550
+ # === Responses
551
+ #
552
+ # - {:close_on_empty_response}[rdoc-ref:Net::HTTP#close_on_empty_response]:
553
+ # Returns whether to close connection on empty response.
554
+ # - {:close_on_empty_response=}[rdoc-ref:Net::HTTP#close_on_empty_response=]:
555
+ # Sets whether to close connection on empty response.
556
+ # - {:ignore_eof}[rdoc-ref:Net::HTTP#ignore_eof]:
557
+ # Returns whether to ignore end-of-file when reading a response body
558
+ # with <tt>Content-Length</tt> headers.
559
+ # - {:ignore_eof=}[rdoc-ref:Net::HTTP#ignore_eof=]:
560
+ # Sets whether to ignore end-of-file when reading a response body
561
+ # with <tt>Content-Length</tt> headers.
562
+ # - {:response_body_encoding}[rdoc-ref:Net::HTTP#response_body_encoding]:
563
+ # Returns the encoding to use for the response body.
564
+ # - {#response_body_encoding=}[rdoc-ref:Net::HTTP#response_body_encoding=]:
565
+ # Sets the response body encoding.
566
+ #
567
+ # === Proxies
568
+ #
569
+ # - {:proxy_address}[rdoc-ref:Net::HTTP#proxy_address]:
570
+ # Returns the proxy address.
571
+ # - {:proxy_address=}[rdoc-ref:Net::HTTP#proxy_address=]:
572
+ # Sets the proxy address.
573
+ # - {::proxy_class?}[rdoc-ref:Net::HTTP.proxy_class?]:
574
+ # Returns whether +self+ is a proxy class.
575
+ # - {#proxy?}[rdoc-ref:Net::HTTP#proxy?]:
576
+ # Returns whether +self+ has a proxy.
577
+ # - {#proxy_address}[rdoc-ref:Net::HTTP#proxy_address]:
578
+ # Returns the proxy address.
579
+ # - {#proxy_from_env?}[rdoc-ref:Net::HTTP#proxy_from_env?]:
580
+ # Returns whether the proxy is taken from an environment variable.
581
+ # - {:proxy_from_env=}[rdoc-ref:Net::HTTP#proxy_from_env=]:
582
+ # Sets whether the proxy is to be taken from an environment variable.
583
+ # - {:proxy_pass}[rdoc-ref:Net::HTTP#proxy_pass]:
584
+ # Returns the proxy password.
585
+ # - {:proxy_pass=}[rdoc-ref:Net::HTTP#proxy_pass=]:
586
+ # Sets the proxy password.
587
+ # - {:proxy_port}[rdoc-ref:Net::HTTP#proxy_port]:
588
+ # Returns the proxy port.
589
+ # - {:proxy_port=}[rdoc-ref:Net::HTTP#proxy_port=]:
590
+ # Sets the proxy port.
591
+ # - {#proxy_user}[rdoc-ref:Net::HTTP#proxy_user]:
592
+ # Returns the proxy user name.
593
+ # - {:proxy_user=}[rdoc-ref:Net::HTTP#proxy_user=]:
594
+ # Sets the proxy user.
595
+ #
596
+ # === Security
597
+ #
598
+ # - {:ca_file}[rdoc-ref:Net::HTTP#ca_file]:
599
+ # Returns the path to a CA certification file.
600
+ # - {:ca_file=}[rdoc-ref:Net::HTTP#ca_file=]:
601
+ # Sets the path to a CA certification file.
602
+ # - {:ca_path}[rdoc-ref:Net::HTTP#ca_path]:
603
+ # Returns the path of to CA directory containing certification files.
604
+ # - {:ca_path=}[rdoc-ref:Net::HTTP#ca_path=]:
605
+ # Sets the path of to CA directory containing certification files.
606
+ # - {:cert}[rdoc-ref:Net::HTTP#cert]:
607
+ # Returns the OpenSSL::X509::Certificate object to be used for client certification.
608
+ # - {:cert=}[rdoc-ref:Net::HTTP#cert=]:
609
+ # Sets the OpenSSL::X509::Certificate object to be used for client certification.
610
+ # - {:cert_store}[rdoc-ref:Net::HTTP#cert_store]:
611
+ # Returns the X509::Store to be used for verifying peer certificate.
612
+ # - {:cert_store=}[rdoc-ref:Net::HTTP#cert_store=]:
613
+ # Sets the X509::Store to be used for verifying peer certificate.
614
+ # - {:ciphers}[rdoc-ref:Net::HTTP#ciphers]:
615
+ # Returns the available SSL ciphers.
616
+ # - {:ciphers=}[rdoc-ref:Net::HTTP#ciphers=]:
617
+ # Sets the available SSL ciphers.
618
+ # - {:extra_chain_cert}[rdoc-ref:Net::HTTP#extra_chain_cert]:
619
+ # Returns the extra X509 certificates to be added to the certificate chain.
620
+ # - {:extra_chain_cert=}[rdoc-ref:Net::HTTP#extra_chain_cert=]:
621
+ # Sets the extra X509 certificates to be added to the certificate chain.
622
+ # - {:key}[rdoc-ref:Net::HTTP#key]:
623
+ # Returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
624
+ # - {:key=}[rdoc-ref:Net::HTTP#key=]:
625
+ # Sets the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
626
+ # - {:max_version}[rdoc-ref:Net::HTTP#max_version]:
627
+ # Returns the maximum SSL version.
628
+ # - {:max_version=}[rdoc-ref:Net::HTTP#max_version=]:
629
+ # Sets the maximum SSL version.
630
+ # - {:min_version}[rdoc-ref:Net::HTTP#min_version]:
631
+ # Returns the minimum SSL version.
632
+ # - {:min_version=}[rdoc-ref:Net::HTTP#min_version=]:
633
+ # Sets the minimum SSL version.
634
+ # - {#peer_cert}[rdoc-ref:Net::HTTP#peer_cert]:
635
+ # Returns the X509 certificate chain for the session's socket peer.
636
+ # - {:ssl_version}[rdoc-ref:Net::HTTP#ssl_version]:
637
+ # Returns the SSL version.
638
+ # - {:ssl_version=}[rdoc-ref:Net::HTTP#ssl_version=]:
639
+ # Sets the SSL version.
640
+ # - {#use_ssl=}[rdoc-ref:Net::HTTP#use_ssl=]:
641
+ # Sets whether a new session is to use Transport Layer Security.
642
+ # - {#use_ssl?}[rdoc-ref:Net::HTTP#use_ssl?]:
643
+ # Returns whether +self+ uses SSL.
644
+ # - {:verify_callback}[rdoc-ref:Net::HTTP#verify_callback]:
645
+ # Returns the callback for the server certification verification.
646
+ # - {:verify_callback=}[rdoc-ref:Net::HTTP#verify_callback=]:
647
+ # Sets the callback for the server certification verification.
648
+ # - {:verify_depth}[rdoc-ref:Net::HTTP#verify_depth]:
649
+ # Returns the maximum depth for the certificate chain verification.
650
+ # - {:verify_depth=}[rdoc-ref:Net::HTTP#verify_depth=]:
651
+ # Sets the maximum depth for the certificate chain verification.
652
+ # - {:verify_hostname}[rdoc-ref:Net::HTTP#verify_hostname]:
653
+ # Returns the flags for server the certification verification at the beginning of the SSL/TLS session.
654
+ # - {:verify_hostname=}[rdoc-ref:Net::HTTP#verify_hostname=]:
655
+ # Sets he flags for server the certification verification at the beginning of the SSL/TLS session.
656
+ # - {:verify_mode}[rdoc-ref:Net::HTTP#verify_mode]:
657
+ # Returns the flags for server the certification verification at the beginning of the SSL/TLS session.
658
+ # - {:verify_mode=}[rdoc-ref:Net::HTTP#verify_mode=]:
659
+ # Sets the flags for server the certification verification at the beginning of the SSL/TLS session.
660
+ #
661
+ # === Addresses and Ports
662
+ #
663
+ # - {:address}[rdoc-ref:Net::HTTP#address]:
664
+ # Returns the string host name or host IP.
665
+ # - {::default_port}[rdoc-ref:Net::HTTP.default_port]:
666
+ # Returns integer 80, the default port to use for HTTP requests.
667
+ # - {::http_default_port}[rdoc-ref:Net::HTTP.http_default_port]:
668
+ # Returns integer 80, the default port to use for HTTP requests.
669
+ # - {::https_default_port}[rdoc-ref:Net::HTTP.https_default_port]:
670
+ # Returns integer 443, the default port to use for HTTPS requests.
671
+ # - {#ipaddr}[rdoc-ref:Net::HTTP#ipaddr]:
672
+ # Returns the IP address for the connection.
673
+ # - {#ipaddr=}[rdoc-ref:Net::HTTP#ipaddr=]:
674
+ # Sets the IP address for the connection.
675
+ # - {:local_host}[rdoc-ref:Net::HTTP#local_host]:
676
+ # Returns the string local host used to establish the connection.
677
+ # - {:local_host=}[rdoc-ref:Net::HTTP#local_host=]:
678
+ # Sets the string local host used to establish the connection.
679
+ # - {:local_port}[rdoc-ref:Net::HTTP#local_port]:
680
+ # Returns the integer local port used to establish the connection.
681
+ # - {:local_port=}[rdoc-ref:Net::HTTP#local_port=]:
682
+ # Sets the integer local port used to establish the connection.
683
+ # - {:port}[rdoc-ref:Net::HTTP#port]:
684
+ # Returns the integer port number.
685
+ #
686
+ # === \HTTP Version
687
+ #
688
+ # - {::version_1_2?}[rdoc-ref:Net::HTTP.version_1_2?]
689
+ # (aliased as {::version_1_2}[rdoc-ref:Net::HTTP.version_1_2]):
690
+ # Returns true; retained for compatibility.
691
+ #
692
+ # === Debugging
693
+ #
694
+ # - {#set_debug_output}[rdoc-ref:Net::HTTP#set_debug_output]:
695
+ # Sets the output stream for debugging.
696
+ #
697
+ # pkg:gem/net-http#lib/net/http.rb:724
698
+ class Net::HTTP < ::Net::Protocol
699
+ # Creates a new \Net::HTTP object for the specified server address,
700
+ # without opening the TCP connection or initializing the \HTTP session.
701
+ # The +address+ should be a DNS hostname or IP address.
702
+ #
703
+ # pkg:gem/net-http#lib/net/http.rb:1148
704
+ def initialize(address, port = T.unsafe(nil)); end
705
+
706
+ # pkg:gem/net-http#lib/net/http.rb:1492
707
+ def active?; end
708
+
709
+ # Returns the string host name or host IP given as argument +address+ in ::new.
710
+ #
711
+ # pkg:gem/net-http#lib/net/http.rb:1265
712
+ def address; end
713
+
714
+ # Sets or returns the path to a CA certification file in PEM format.
715
+ #
716
+ # pkg:gem/net-http#lib/net/http.rb:1539
717
+ def ca_file; end
718
+
719
+ # Sets or returns the path to a CA certification file in PEM format.
720
+ #
721
+ # pkg:gem/net-http#lib/net/http.rb:1539
722
+ def ca_file=(_arg0); end
723
+
724
+ # Sets or returns the path of to CA directory
725
+ # containing certification files in PEM format.
726
+ #
727
+ # pkg:gem/net-http#lib/net/http.rb:1543
728
+ def ca_path; end
729
+
730
+ # Sets or returns the path of to CA directory
731
+ # containing certification files in PEM format.
732
+ #
733
+ # pkg:gem/net-http#lib/net/http.rb:1543
734
+ def ca_path=(_arg0); end
735
+
736
+ # Sets or returns the OpenSSL::X509::Certificate object
737
+ # to be used for client certification.
738
+ #
739
+ # pkg:gem/net-http#lib/net/http.rb:1547
740
+ def cert; end
741
+
742
+ # Sets or returns the OpenSSL::X509::Certificate object
743
+ # to be used for client certification.
744
+ #
745
+ # pkg:gem/net-http#lib/net/http.rb:1547
746
+ def cert=(_arg0); end
747
+
748
+ # Sets or returns the X509::Store to be used for verifying peer certificate.
749
+ #
750
+ # pkg:gem/net-http#lib/net/http.rb:1550
751
+ def cert_store; end
752
+
753
+ # Sets or returns the X509::Store to be used for verifying peer certificate.
754
+ #
755
+ # pkg:gem/net-http#lib/net/http.rb:1550
756
+ def cert_store=(_arg0); end
757
+
758
+ # Sets or returns the available SSL ciphers.
759
+ # See {OpenSSL::SSL::SSLContext#ciphers=}[OpenSSL::SSL::SSL::Context#ciphers=].
760
+ #
761
+ # pkg:gem/net-http#lib/net/http.rb:1554
762
+ def ciphers; end
763
+
764
+ # Sets or returns the available SSL ciphers.
765
+ # See {OpenSSL::SSL::SSLContext#ciphers=}[OpenSSL::SSL::SSL::Context#ciphers=].
766
+ #
767
+ # pkg:gem/net-http#lib/net/http.rb:1554
768
+ def ciphers=(_arg0); end
769
+
770
+ # Sets or returns whether to close the connection when the response is empty;
771
+ # initially +false+.
772
+ #
773
+ # pkg:gem/net-http#lib/net/http.rb:1496
774
+ def close_on_empty_response; end
775
+
776
+ # Sets or returns whether to close the connection when the response is empty;
777
+ # initially +false+.
778
+ #
779
+ # pkg:gem/net-http#lib/net/http.rb:1496
780
+ def close_on_empty_response=(_arg0); end
781
+
782
+ # Returns the continue timeout value;
783
+ # see continue_timeout=.
784
+ #
785
+ # pkg:gem/net-http#lib/net/http.rb:1449
786
+ def continue_timeout; end
787
+
788
+ # Sets the continue timeout value,
789
+ # which is the number of seconds to wait for an expected 100 Continue response.
790
+ # If the \HTTP object does not receive a response in this many seconds
791
+ # it sends the request body.
792
+ #
793
+ # pkg:gem/net-http#lib/net/http.rb:1455
794
+ def continue_timeout=(sec); end
795
+
796
+ # Sends a COPY request to the server;
797
+ # returns an instance of a subclass of Net::HTTPResponse.
798
+ #
799
+ # The request is based on the Net::HTTP::Copy object
800
+ # created from string +path+ and initial headers hash +initheader+.
801
+ #
802
+ # http = Net::HTTP.new(hostname)
803
+ # http.copy('/todos/1')
804
+ #
805
+ # pkg:gem/net-http#lib/net/http.rb:2227
806
+ def copy(path, initheader = T.unsafe(nil)); end
807
+
808
+ # Sends a DELETE request to the server;
809
+ # returns an instance of a subclass of Net::HTTPResponse.
810
+ #
811
+ # The request is based on the Net::HTTP::Delete object
812
+ # created from string +path+ and initial headers hash +initheader+.
813
+ #
814
+ # http = Net::HTTP.new(hostname)
815
+ # http.delete('/todos/1')
816
+ #
817
+ # pkg:gem/net-http#lib/net/http.rb:2201
818
+ def delete(path, initheader = T.unsafe(nil)); end
819
+
820
+ # Sets or returns the extra X509 certificates to be added to the certificate chain.
821
+ # See {OpenSSL::SSL::SSLContext#add_certificate}[OpenSSL::SSL::SSL::Context#add_certificate].
822
+ #
823
+ # pkg:gem/net-http#lib/net/http.rb:1558
824
+ def extra_chain_cert; end
825
+
826
+ # Sets or returns the extra X509 certificates to be added to the certificate chain.
827
+ # See {OpenSSL::SSL::SSLContext#add_certificate}[OpenSSL::SSL::SSL::Context#add_certificate].
828
+ #
829
+ # pkg:gem/net-http#lib/net/http.rb:1558
830
+ def extra_chain_cert=(_arg0); end
831
+
832
+ # Finishes the \HTTP session:
833
+ #
834
+ # http = Net::HTTP.new(hostname)
835
+ # http.start
836
+ # http.started? # => true
837
+ # http.finish # => nil
838
+ # http.started? # => false
839
+ #
840
+ # Raises IOError if not in a session.
841
+ #
842
+ # pkg:gem/net-http#lib/net/http.rb:1648
843
+ def finish; end
844
+
845
+ # :call-seq:
846
+ # get(path, initheader = nil) {|res| ... }
847
+ #
848
+ # Sends a GET request to the server;
849
+ # returns an instance of a subclass of Net::HTTPResponse.
850
+ #
851
+ # The request is based on the Net::HTTP::Get object
852
+ # created from string +path+ and initial headers hash +initheader+.
853
+ #
854
+ # With a block given, calls the block with the response body:
855
+ #
856
+ # http = Net::HTTP.new(hostname)
857
+ # http.get('/todos/1') do |res|
858
+ # p res
859
+ # end # => #<Net::HTTPOK 200 OK readbody=true>
860
+ #
861
+ # Output:
862
+ #
863
+ # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}"
864
+ #
865
+ # With no block given, simply returns the response object:
866
+ #
867
+ # http.get('/') # => #<Net::HTTPOK 200 OK readbody=true>
868
+ #
869
+ # Related:
870
+ #
871
+ # - Net::HTTP::Get: request class for \HTTP method GET.
872
+ # - Net::HTTP.get: sends GET request, returns response body.
873
+ #
874
+ # pkg:gem/net-http#lib/net/http.rb:2013
875
+ def get(path, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end
876
+
877
+ # pkg:gem/net-http#lib/net/http.rb:2338
878
+ def get2(path, initheader = T.unsafe(nil), &block); end
879
+
880
+ # Sends a HEAD request to the server;
881
+ # returns an instance of a subclass of Net::HTTPResponse.
882
+ #
883
+ # The request is based on the Net::HTTP::Head object
884
+ # created from string +path+ and initial headers hash +initheader+:
885
+ #
886
+ # res = http.head('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
887
+ # res.body # => nil
888
+ # res.to_hash.take(3)
889
+ # # =>
890
+ # [["date", ["Wed, 15 Feb 2023 15:25:42 GMT"]],
891
+ # ["content-type", ["application/json; charset=utf-8"]],
892
+ # ["connection", ["close"]]]
893
+ #
894
+ # pkg:gem/net-http#lib/net/http.rb:2037
895
+ def head(path, initheader = T.unsafe(nil)); end
896
+
897
+ # pkg:gem/net-http#lib/net/http.rb:2339
898
+ def head2(path, initheader = T.unsafe(nil), &block); end
899
+
900
+ # Sets or returns whether to ignore end-of-file when reading a response body
901
+ # with <tt>Content-Length</tt> headers;
902
+ # initially +true+.
903
+ #
904
+ # pkg:gem/net-http#lib/net/http.rb:1472
905
+ def ignore_eof; end
906
+
907
+ # Sets or returns whether to ignore end-of-file when reading a response body
908
+ # with <tt>Content-Length</tt> headers;
909
+ # initially +true+.
910
+ #
911
+ # pkg:gem/net-http#lib/net/http.rb:1472
912
+ def ignore_eof=(_arg0); end
913
+
914
+ # Returns a string representation of +self+:
915
+ #
916
+ # Net::HTTP.new(hostname).inspect
917
+ # # => "#<Net::HTTP jsonplaceholder.typicode.com:80 open=false>"
918
+ #
919
+ # pkg:gem/net-http#lib/net/http.rb:1206
920
+ def inspect; end
921
+
922
+ # Returns the IP address for the connection.
923
+ #
924
+ # If the session has not been started,
925
+ # returns the value set by #ipaddr=,
926
+ # or +nil+ if it has not been set:
927
+ #
928
+ # http = Net::HTTP.new(hostname)
929
+ # http.ipaddr # => nil
930
+ # http.ipaddr = '172.67.155.76'
931
+ # http.ipaddr # => "172.67.155.76"
932
+ #
933
+ # If the session has been started,
934
+ # returns the IP address from the socket:
935
+ #
936
+ # http = Net::HTTP.new(hostname)
937
+ # http.start
938
+ # http.ipaddr # => "172.67.155.76"
939
+ # http.finish
940
+ #
941
+ # pkg:gem/net-http#lib/net/http.rb:1349
942
+ def ipaddr; end
943
+
944
+ # Sets the IP address for the connection:
945
+ #
946
+ # http = Net::HTTP.new(hostname)
947
+ # http.ipaddr # => nil
948
+ # http.ipaddr = '172.67.155.76'
949
+ # http.ipaddr # => "172.67.155.76"
950
+ #
951
+ # The IP address may not be set if the session has been started.
952
+ #
953
+ # pkg:gem/net-http#lib/net/http.rb:1361
954
+ def ipaddr=(addr); end
955
+
956
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
957
+ # to keep the connection open after a request is sent;
958
+ # initially 2.
959
+ # If a new request is made during the given interval,
960
+ # the still-open connection is used;
961
+ # otherwise the connection will have been closed
962
+ # and a new connection is opened.
963
+ #
964
+ # pkg:gem/net-http#lib/net/http.rb:1467
965
+ def keep_alive_timeout; end
966
+
967
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
968
+ # to keep the connection open after a request is sent;
969
+ # initially 2.
970
+ # If a new request is made during the given interval,
971
+ # the still-open connection is used;
972
+ # otherwise the connection will have been closed
973
+ # and a new connection is opened.
974
+ #
975
+ # pkg:gem/net-http#lib/net/http.rb:1467
976
+ def keep_alive_timeout=(_arg0); end
977
+
978
+ # Sets or returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
979
+ #
980
+ # pkg:gem/net-http#lib/net/http.rb:1561
981
+ def key; end
982
+
983
+ # Sets or returns the OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
984
+ #
985
+ # pkg:gem/net-http#lib/net/http.rb:1561
986
+ def key=(_arg0); end
987
+
988
+ # Sets or returns the string local host used to establish the connection;
989
+ # initially +nil+.
990
+ #
991
+ # pkg:gem/net-http#lib/net/http.rb:1272
992
+ def local_host; end
993
+
994
+ # Sets or returns the string local host used to establish the connection;
995
+ # initially +nil+.
996
+ #
997
+ # pkg:gem/net-http#lib/net/http.rb:1272
998
+ def local_host=(_arg0); end
999
+
1000
+ # Sets or returns the integer local port used to establish the connection;
1001
+ # initially +nil+.
1002
+ #
1003
+ # pkg:gem/net-http#lib/net/http.rb:1276
1004
+ def local_port; end
1005
+
1006
+ # Sets or returns the integer local port used to establish the connection;
1007
+ # initially +nil+.
1008
+ #
1009
+ # pkg:gem/net-http#lib/net/http.rb:1276
1010
+ def local_port=(_arg0); end
1011
+
1012
+ # Sends a LOCK request to the server;
1013
+ # returns an instance of a subclass of Net::HTTPResponse.
1014
+ #
1015
+ # The request is based on the Net::HTTP::Lock object
1016
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1017
+ #
1018
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1019
+ # http = Net::HTTP.new(hostname)
1020
+ # http.lock('/todos/1', data)
1021
+ #
1022
+ # pkg:gem/net-http#lib/net/http.rb:2147
1023
+ def lock(path, body, initheader = T.unsafe(nil)); end
1024
+
1025
+ # Returns the maximum number of times to retry an idempotent request;
1026
+ # see #max_retries=.
1027
+ #
1028
+ # pkg:gem/net-http#lib/net/http.rb:1405
1029
+ def max_retries; end
1030
+
1031
+ # Sets the maximum number of times to retry an idempotent request in case of
1032
+ # \Net::ReadTimeout, IOError, EOFError, Errno::ECONNRESET,
1033
+ # Errno::ECONNABORTED, Errno::EPIPE, OpenSSL::SSL::SSLError,
1034
+ # Timeout::Error.
1035
+ # The initial value is 1.
1036
+ #
1037
+ # Argument +retries+ must be a non-negative numeric value:
1038
+ #
1039
+ # http = Net::HTTP.new(hostname)
1040
+ # http.max_retries = 2 # => 2
1041
+ # http.max_retries # => 2
1042
+ #
1043
+ # pkg:gem/net-http#lib/net/http.rb:1395
1044
+ def max_retries=(retries); end
1045
+
1046
+ # Sets or returns the maximum SSL version.
1047
+ # See {OpenSSL::SSL::SSLContext#max_version=}[OpenSSL::SSL::SSL::Context#max_version=].
1048
+ #
1049
+ # pkg:gem/net-http#lib/net/http.rb:1576
1050
+ def max_version; end
1051
+
1052
+ # Sets or returns the maximum SSL version.
1053
+ # See {OpenSSL::SSL::SSLContext#max_version=}[OpenSSL::SSL::SSL::Context#max_version=].
1054
+ #
1055
+ # pkg:gem/net-http#lib/net/http.rb:1576
1056
+ def max_version=(_arg0); end
1057
+
1058
+ # Sets or returns the minimum SSL version.
1059
+ # See {OpenSSL::SSL::SSLContext#min_version=}[OpenSSL::SSL::SSL::Context#min_version=].
1060
+ #
1061
+ # pkg:gem/net-http#lib/net/http.rb:1572
1062
+ def min_version; end
1063
+
1064
+ # Sets or returns the minimum SSL version.
1065
+ # See {OpenSSL::SSL::SSLContext#min_version=}[OpenSSL::SSL::SSL::Context#min_version=].
1066
+ #
1067
+ # pkg:gem/net-http#lib/net/http.rb:1572
1068
+ def min_version=(_arg0); end
1069
+
1070
+ # Sends a MKCOL request to the server;
1071
+ # returns an instance of a subclass of Net::HTTPResponse.
1072
+ #
1073
+ # The request is based on the Net::HTTP::Mkcol object
1074
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1075
+ #
1076
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1077
+ # http.mkcol('/todos/1', data)
1078
+ # http = Net::HTTP.new(hostname)
1079
+ #
1080
+ # pkg:gem/net-http#lib/net/http.rb:2241
1081
+ def mkcol(path, body = T.unsafe(nil), initheader = T.unsafe(nil)); end
1082
+
1083
+ # Sends a MOVE request to the server;
1084
+ # returns an instance of a subclass of Net::HTTPResponse.
1085
+ #
1086
+ # The request is based on the Net::HTTP::Move object
1087
+ # created from string +path+ and initial headers hash +initheader+.
1088
+ #
1089
+ # http = Net::HTTP.new(hostname)
1090
+ # http.move('/todos/1')
1091
+ #
1092
+ # pkg:gem/net-http#lib/net/http.rb:2214
1093
+ def move(path, initheader = T.unsafe(nil)); end
1094
+
1095
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
1096
+ # to wait for a connection to open;
1097
+ # initially 60.
1098
+ # If the connection is not made in the given interval,
1099
+ # an exception is raised.
1100
+ #
1101
+ # pkg:gem/net-http#lib/net/http.rb:1371
1102
+ def open_timeout; end
1103
+
1104
+ # Sets or returns the numeric (\Integer or \Float) number of seconds
1105
+ # to wait for a connection to open;
1106
+ # initially 60.
1107
+ # If the connection is not made in the given interval,
1108
+ # an exception is raised.
1109
+ #
1110
+ # pkg:gem/net-http#lib/net/http.rb:1371
1111
+ def open_timeout=(_arg0); end
1112
+
1113
+ # Sends an Options request to the server;
1114
+ # returns an instance of a subclass of Net::HTTPResponse.
1115
+ #
1116
+ # The request is based on the Net::HTTP::Options object
1117
+ # created from string +path+ and initial headers hash +initheader+.
1118
+ #
1119
+ # http = Net::HTTP.new(hostname)
1120
+ # http.options('/')
1121
+ #
1122
+ # pkg:gem/net-http#lib/net/http.rb:2174
1123
+ def options(path, initheader = T.unsafe(nil)); end
1124
+
1125
+ # :call-seq:
1126
+ # patch(path, data, initheader = nil) {|res| ... }
1127
+ #
1128
+ # Sends a PATCH request to the server;
1129
+ # returns an instance of a subclass of Net::HTTPResponse.
1130
+ #
1131
+ # The request is based on the Net::HTTP::Patch object
1132
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1133
+ #
1134
+ # With a block given, calls the block with the response body:
1135
+ #
1136
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1137
+ # http = Net::HTTP.new(hostname)
1138
+ # http.patch('/todos/1', data) do |res|
1139
+ # p res
1140
+ # end # => #<Net::HTTPOK 200 OK readbody=true>
1141
+ #
1142
+ # Output:
1143
+ #
1144
+ # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false,\n \"{\\\"userId\\\": 1, \\\"id\\\": 1, \\\"title\\\": \\\"delectus aut autem\\\", \\\"completed\\\": false}\": \"\"\n}"
1145
+ #
1146
+ # With no block given, simply returns the response object:
1147
+ #
1148
+ # http.patch('/todos/1', data) # => #<Net::HTTPCreated 201 Created readbody=true>
1149
+ #
1150
+ # pkg:gem/net-http#lib/net/http.rb:2100
1151
+ def patch(path, data, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end
1152
+
1153
+ # Returns the X509 certificate chain (an array of strings)
1154
+ # for the session's socket peer,
1155
+ # or +nil+ if none.
1156
+ #
1157
+ # pkg:gem/net-http#lib/net/http.rb:1597
1158
+ def peer_cert; end
1159
+
1160
+ # Returns the integer port number given as argument +port+ in ::new.
1161
+ #
1162
+ # pkg:gem/net-http#lib/net/http.rb:1268
1163
+ def port; end
1164
+
1165
+ # :call-seq:
1166
+ # post(path, data, initheader = nil) {|res| ... }
1167
+ #
1168
+ # Sends a POST request to the server;
1169
+ # returns an instance of a subclass of Net::HTTPResponse.
1170
+ #
1171
+ # The request is based on the Net::HTTP::Post object
1172
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1173
+ #
1174
+ # With a block given, calls the block with the response body:
1175
+ #
1176
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1177
+ # http = Net::HTTP.new(hostname)
1178
+ # http.post('/todos', data) do |res|
1179
+ # p res
1180
+ # end # => #<Net::HTTPCreated 201 Created readbody=true>
1181
+ #
1182
+ # Output:
1183
+ #
1184
+ # "{\n \"{\\\"userId\\\": 1, \\\"id\\\": 1, \\\"title\\\": \\\"delectus aut autem\\\", \\\"completed\\\": false}\": \"\",\n \"id\": 201\n}"
1185
+ #
1186
+ # With no block given, simply returns the response object:
1187
+ #
1188
+ # http.post('/todos', data) # => #<Net::HTTPCreated 201 Created readbody=true>
1189
+ #
1190
+ # Related:
1191
+ #
1192
+ # - Net::HTTP::Post: request class for \HTTP method POST.
1193
+ # - Net::HTTP.post: sends POST request, returns response body.
1194
+ #
1195
+ # pkg:gem/net-http#lib/net/http.rb:2071
1196
+ def post(path, data, initheader = T.unsafe(nil), dest = T.unsafe(nil), &block); end
1197
+
1198
+ # pkg:gem/net-http#lib/net/http.rb:2340
1199
+ def post2(path, data, initheader = T.unsafe(nil), &block); end
1200
+
1201
+ # Sends a PROPFIND request to the server;
1202
+ # returns an instance of a subclass of Net::HTTPResponse.
1203
+ #
1204
+ # The request is based on the Net::HTTP::Propfind object
1205
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1206
+ #
1207
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1208
+ # http = Net::HTTP.new(hostname)
1209
+ # http.propfind('/todos/1', data)
1210
+ #
1211
+ # pkg:gem/net-http#lib/net/http.rb:2188
1212
+ def propfind(path, body = T.unsafe(nil), initheader = T.unsafe(nil)); end
1213
+
1214
+ # Sends a PROPPATCH request to the server;
1215
+ # returns an instance of a subclass of Net::HTTPResponse.
1216
+ #
1217
+ # The request is based on the Net::HTTP::Proppatch object
1218
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1219
+ #
1220
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1221
+ # http = Net::HTTP.new(hostname)
1222
+ # http.proppatch('/todos/1', data)
1223
+ #
1224
+ # pkg:gem/net-http#lib/net/http.rb:2133
1225
+ def proppatch(path, body, initheader = T.unsafe(nil)); end
1226
+
1227
+ # Returns +true+ if a proxy server is defined, +false+ otherwise;
1228
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1229
+ #
1230
+ # pkg:gem/net-http#lib/net/http.rb:1881
1231
+ def proxy?; end
1232
+
1233
+ # Sets the proxy address;
1234
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1235
+ # Returns the address of the proxy server, if defined, +nil+ otherwise;
1236
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1237
+ #
1238
+ # pkg:gem/net-http#lib/net/http.rb:1903
1239
+ def proxy_address; end
1240
+
1241
+ # Sets the proxy address;
1242
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1243
+ # Returns the address of the proxy server, if defined, +nil+ otherwise;
1244
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1245
+ #
1246
+ # pkg:gem/net-http#lib/net/http.rb:1312
1247
+ def proxy_address=(_arg0); end
1248
+
1249
+ # Sets whether to determine the proxy from environment variable
1250
+ # '<tt>ENV['http_proxy']</tt>';
1251
+ # see {Proxy Using ENV['http_proxy']}[rdoc-ref:Net::HTTP@Proxy+Using+-27ENV-5B-27http_proxy-27-5D-27].
1252
+ #
1253
+ # pkg:gem/net-http#lib/net/http.rb:1308
1254
+ def proxy_from_env=(_arg0); end
1255
+
1256
+ # Returns +true+ if the proxy server is defined in the environment,
1257
+ # +false+ otherwise;
1258
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1259
+ #
1260
+ # pkg:gem/net-http#lib/net/http.rb:1888
1261
+ def proxy_from_env?; end
1262
+
1263
+ # Returns the password of the proxy server, if defined, +nil+ otherwise;
1264
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1265
+ # Sets the proxy password;
1266
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1267
+ #
1268
+ # pkg:gem/net-http#lib/net/http.rb:1934
1269
+ def proxy_pass; end
1270
+
1271
+ # Returns the password of the proxy server, if defined, +nil+ otherwise;
1272
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1273
+ # Sets the proxy password;
1274
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1275
+ #
1276
+ # pkg:gem/net-http#lib/net/http.rb:1324
1277
+ def proxy_pass=(_arg0); end
1278
+
1279
+ # Sets the proxy port;
1280
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1281
+ # Returns the port number of the proxy server, if defined, +nil+ otherwise;
1282
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1283
+ #
1284
+ # pkg:gem/net-http#lib/net/http.rb:1913
1285
+ def proxy_port; end
1286
+
1287
+ # Sets the proxy port;
1288
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1289
+ # Returns the port number of the proxy server, if defined, +nil+ otherwise;
1290
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1291
+ #
1292
+ # pkg:gem/net-http#lib/net/http.rb:1316
1293
+ def proxy_port=(_arg0); end
1294
+
1295
+ # The proxy URI determined from the environment for this connection.
1296
+ #
1297
+ # pkg:gem/net-http#lib/net/http.rb:1893
1298
+ def proxy_uri; end
1299
+
1300
+ # Sets whether the proxy uses SSL;
1301
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1302
+ #
1303
+ # pkg:gem/net-http#lib/net/http.rb:1328
1304
+ def proxy_use_ssl=(_arg0); end
1305
+
1306
+ # Returns the user name of the proxy server, if defined, +nil+ otherwise;
1307
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1308
+ # Sets the proxy user;
1309
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1310
+ #
1311
+ # pkg:gem/net-http#lib/net/http.rb:1923
1312
+ def proxy_user; end
1313
+
1314
+ # Returns the user name of the proxy server, if defined, +nil+ otherwise;
1315
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1316
+ # Sets the proxy user;
1317
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1318
+ #
1319
+ # pkg:gem/net-http#lib/net/http.rb:1320
1320
+ def proxy_user=(_arg0); end
1321
+
1322
+ # pkg:gem/net-http#lib/net/http.rb:1943
1323
+ def proxyaddr; end
1324
+
1325
+ # pkg:gem/net-http#lib/net/http.rb:1944
1326
+ def proxyport; end
1327
+
1328
+ # Sends a PUT request to the server;
1329
+ # returns an instance of a subclass of Net::HTTPResponse.
1330
+ #
1331
+ # The request is based on the Net::HTTP::Put object
1332
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1333
+ #
1334
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1335
+ # http = Net::HTTP.new(hostname)
1336
+ # http.put('/todos/1', data) # => #<Net::HTTPOK 200 OK readbody=true>
1337
+ #
1338
+ # Related:
1339
+ #
1340
+ # - Net::HTTP::Put: request class for \HTTP method PUT.
1341
+ # - Net::HTTP.put: sends PUT request, returns response body.
1342
+ #
1343
+ # pkg:gem/net-http#lib/net/http.rb:2119
1344
+ def put(path, data, initheader = T.unsafe(nil)); end
1345
+
1346
+ # pkg:gem/net-http#lib/net/http.rb:2341
1347
+ def put2(path, data, initheader = T.unsafe(nil), &block); end
1348
+
1349
+ # Returns the numeric (\Integer or \Float) number of seconds
1350
+ # to wait for one block to be read (via one read(2) call);
1351
+ # see #read_timeout=.
1352
+ #
1353
+ # pkg:gem/net-http#lib/net/http.rb:1376
1354
+ def read_timeout; end
1355
+
1356
+ # Sets the read timeout, in seconds, for +self+ to integer +sec+;
1357
+ # the initial value is 60.
1358
+ #
1359
+ # Argument +sec+ must be a non-negative numeric value:
1360
+ #
1361
+ # http = Net::HTTP.new(hostname)
1362
+ # http.read_timeout # => 60
1363
+ # http.get('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1364
+ # http.read_timeout = 0
1365
+ # http.get('/todos/1') # Raises Net::ReadTimeout.
1366
+ #
1367
+ # pkg:gem/net-http#lib/net/http.rb:1418
1368
+ def read_timeout=(sec); end
1369
+
1370
+ # Sends the given request +req+ to the server;
1371
+ # forms the response into a Net::HTTPResponse object.
1372
+ #
1373
+ # The given +req+ must be an instance of a
1374
+ # {subclass of Net::HTTPRequest}[rdoc-ref:Net::HTTPRequest@Request+Subclasses].
1375
+ # Argument +body+ should be given only if needed for the request.
1376
+ #
1377
+ # With no block given, returns the response object:
1378
+ #
1379
+ # http = Net::HTTP.new(hostname)
1380
+ #
1381
+ # req = Net::HTTP::Get.new('/todos/1')
1382
+ # http.request(req)
1383
+ # # => #<Net::HTTPOK 200 OK readbody=true>
1384
+ #
1385
+ # req = Net::HTTP::Post.new('/todos')
1386
+ # http.request(req, 'xyzzy')
1387
+ # # => #<Net::HTTPCreated 201 Created readbody=true>
1388
+ #
1389
+ # With a block given, calls the block with the response and returns the response:
1390
+ #
1391
+ # req = Net::HTTP::Get.new('/todos/1')
1392
+ # http.request(req) do |res|
1393
+ # p res
1394
+ # end # => #<Net::HTTPOK 200 OK readbody=true>
1395
+ #
1396
+ # Output:
1397
+ #
1398
+ # #<Net::HTTPOK 200 OK readbody=false>
1399
+ #
1400
+ # pkg:gem/net-http#lib/net/http.rb:2399
1401
+ def request(req, body = T.unsafe(nil), &block); end
1402
+
1403
+ # Sends a GET request to the server;
1404
+ # forms the response into a Net::HTTPResponse object.
1405
+ #
1406
+ # The request is based on the Net::HTTP::Get object
1407
+ # created from string +path+ and initial headers hash +initheader+.
1408
+ #
1409
+ # With no block given, returns the response object:
1410
+ #
1411
+ # http = Net::HTTP.new(hostname)
1412
+ # http.request_get('/todos') # => #<Net::HTTPOK 200 OK readbody=true>
1413
+ #
1414
+ # With a block given, calls the block with the response object
1415
+ # and returns the response object:
1416
+ #
1417
+ # http.request_get('/todos') do |res|
1418
+ # p res
1419
+ # end # => #<Net::HTTPOK 200 OK readbody=true>
1420
+ #
1421
+ # Output:
1422
+ #
1423
+ # #<Net::HTTPOK 200 OK readbody=false>
1424
+ #
1425
+ # pkg:gem/net-http#lib/net/http.rb:2280
1426
+ def request_get(path, initheader = T.unsafe(nil), &block); end
1427
+
1428
+ # Sends a HEAD request to the server;
1429
+ # returns an instance of a subclass of Net::HTTPResponse.
1430
+ #
1431
+ # The request is based on the Net::HTTP::Head object
1432
+ # created from string +path+ and initial headers hash +initheader+.
1433
+ #
1434
+ # http = Net::HTTP.new(hostname)
1435
+ # http.head('/todos/1') # => #<Net::HTTPOK 200 OK readbody=true>
1436
+ #
1437
+ # pkg:gem/net-http#lib/net/http.rb:2293
1438
+ def request_head(path, initheader = T.unsafe(nil), &block); end
1439
+
1440
+ # Sends a POST request to the server;
1441
+ # forms the response into a Net::HTTPResponse object.
1442
+ #
1443
+ # The request is based on the Net::HTTP::Post object
1444
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1445
+ #
1446
+ # With no block given, returns the response object:
1447
+ #
1448
+ # http = Net::HTTP.new(hostname)
1449
+ # http.post('/todos', 'xyzzy')
1450
+ # # => #<Net::HTTPCreated 201 Created readbody=true>
1451
+ #
1452
+ # With a block given, calls the block with the response body
1453
+ # and returns the response object:
1454
+ #
1455
+ # http.post('/todos', 'xyzzy') do |res|
1456
+ # p res
1457
+ # end # => #<Net::HTTPCreated 201 Created readbody=true>
1458
+ #
1459
+ # Output:
1460
+ #
1461
+ # "{\n \"xyzzy\": \"\",\n \"id\": 201\n}"
1462
+ #
1463
+ # pkg:gem/net-http#lib/net/http.rb:2320
1464
+ def request_post(path, data, initheader = T.unsafe(nil), &block); end
1465
+
1466
+ # Sends a PUT request to the server;
1467
+ # returns an instance of a subclass of Net::HTTPResponse.
1468
+ #
1469
+ # The request is based on the Net::HTTP::Put object
1470
+ # created from string +path+, string +data+, and initial headers hash +initheader+.
1471
+ #
1472
+ # http = Net::HTTP.new(hostname)
1473
+ # http.put('/todos/1', 'xyzzy')
1474
+ # # => #<Net::HTTPOK 200 OK readbody=true>
1475
+ #
1476
+ # pkg:gem/net-http#lib/net/http.rb:2334
1477
+ def request_put(path, data, initheader = T.unsafe(nil), &block); end
1478
+
1479
+ # Returns the encoding to use for the response body;
1480
+ # see #response_body_encoding=.
1481
+ #
1482
+ # pkg:gem/net-http#lib/net/http.rb:1280
1483
+ def response_body_encoding; end
1484
+
1485
+ # Sets the encoding to be used for the response body;
1486
+ # returns the encoding.
1487
+ #
1488
+ # The given +value+ may be:
1489
+ #
1490
+ # - An Encoding object.
1491
+ # - The name of an encoding.
1492
+ # - An alias for an encoding name.
1493
+ #
1494
+ # See {Encoding}[https://docs.ruby-lang.org/en/master/Encoding.html].
1495
+ #
1496
+ # Examples:
1497
+ #
1498
+ # http = Net::HTTP.new(hostname)
1499
+ # http.response_body_encoding = Encoding::US_ASCII # => #<Encoding:US-ASCII>
1500
+ # http.response_body_encoding = 'US-ASCII' # => "US-ASCII"
1501
+ # http.response_body_encoding = 'ASCII' # => "ASCII"
1502
+ #
1503
+ # pkg:gem/net-http#lib/net/http.rb:1300
1504
+ def response_body_encoding=(value); end
1505
+
1506
+ # Sends an \HTTP request to the server;
1507
+ # returns an instance of a subclass of Net::HTTPResponse.
1508
+ #
1509
+ # The request is based on the Net::HTTPRequest object
1510
+ # created from string +path+, string +data+, and initial headers hash +header+.
1511
+ # That object is an instance of the
1512
+ # {subclass of Net::HTTPRequest}[rdoc-ref:Net::HTTPRequest@Request+Subclasses],
1513
+ # that corresponds to the given uppercase string +name+,
1514
+ # which must be
1515
+ # an {HTTP request method}[https://en.wikipedia.org/wiki/HTTP#Request_methods]
1516
+ # or a {WebDAV request method}[https://en.wikipedia.org/wiki/WebDAV#Implementation].
1517
+ #
1518
+ # Examples:
1519
+ #
1520
+ # http = Net::HTTP.new(hostname)
1521
+ # http.send_request('GET', '/todos/1')
1522
+ # # => #<Net::HTTPOK 200 OK readbody=true>
1523
+ # http.send_request('POST', '/todos', 'xyzzy')
1524
+ # # => #<Net::HTTPCreated 201 Created readbody=true>
1525
+ #
1526
+ # pkg:gem/net-http#lib/net/http.rb:2363
1527
+ def send_request(name, path, data = T.unsafe(nil), header = T.unsafe(nil)); end
1528
+
1529
+ # *WARNING* This method opens a serious security hole.
1530
+ # Never use this method in production code.
1531
+ #
1532
+ # Sets the output stream for debugging:
1533
+ #
1534
+ # http = Net::HTTP.new(hostname)
1535
+ # File.open('t.tmp', 'w') do |file|
1536
+ # http.set_debug_output(file)
1537
+ # http.start
1538
+ # http.get('/nosuch/1')
1539
+ # http.finish
1540
+ # end
1541
+ # puts File.read('t.tmp')
1542
+ #
1543
+ # Output:
1544
+ #
1545
+ # opening connection to jsonplaceholder.typicode.com:80...
1546
+ # opened
1547
+ # <- "GET /nosuch/1 HTTP/1.1\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: jsonplaceholder.typicode.com\r\n\r\n"
1548
+ # -> "HTTP/1.1 404 Not Found\r\n"
1549
+ # -> "Date: Mon, 12 Dec 2022 21:14:11 GMT\r\n"
1550
+ # -> "Content-Type: application/json; charset=utf-8\r\n"
1551
+ # -> "Content-Length: 2\r\n"
1552
+ # -> "Connection: keep-alive\r\n"
1553
+ # -> "X-Powered-By: Express\r\n"
1554
+ # -> "X-Ratelimit-Limit: 1000\r\n"
1555
+ # -> "X-Ratelimit-Remaining: 999\r\n"
1556
+ # -> "X-Ratelimit-Reset: 1670879660\r\n"
1557
+ # -> "Vary: Origin, Accept-Encoding\r\n"
1558
+ # -> "Access-Control-Allow-Credentials: true\r\n"
1559
+ # -> "Cache-Control: max-age=43200\r\n"
1560
+ # -> "Pragma: no-cache\r\n"
1561
+ # -> "Expires: -1\r\n"
1562
+ # -> "X-Content-Type-Options: nosniff\r\n"
1563
+ # -> "Etag: W/\"2-vyGp6PvFo4RvsFtPoIWeCReyIC8\"\r\n"
1564
+ # -> "Via: 1.1 vegur\r\n"
1565
+ # -> "CF-Cache-Status: MISS\r\n"
1566
+ # -> "Server-Timing: cf-q-config;dur=1.3000000762986e-05\r\n"
1567
+ # -> "Report-To: {\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=yOr40jo%2BwS1KHzhTlVpl54beJ5Wx2FcG4gGV0XVrh3X9OlR5q4drUn2dkt5DGO4GDcE%2BVXT7CNgJvGs%2BZleIyMu8CLieFiDIvOviOY3EhHg94m0ZNZgrEdpKD0S85S507l1vsEwEHkoTm%2Ff19SiO\"}],\"group\":\"cf-nel\",\"max_age\":604800}\r\n"
1568
+ # -> "NEL: {\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}\r\n"
1569
+ # -> "Server: cloudflare\r\n"
1570
+ # -> "CF-RAY: 778977dc484ce591-DFW\r\n"
1571
+ # -> "alt-svc: h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400\r\n"
1572
+ # -> "\r\n"
1573
+ # reading 2 bytes...
1574
+ # -> "{}"
1575
+ # read 2 bytes
1576
+ # Conn keep-alive
1577
+ #
1578
+ # pkg:gem/net-http#lib/net/http.rb:1259
1579
+ def set_debug_output(output); end
1580
+
1581
+ # Sets or returns the SSL timeout seconds.
1582
+ #
1583
+ # pkg:gem/net-http#lib/net/http.rb:1564
1584
+ def ssl_timeout; end
1585
+
1586
+ # Sets or returns the SSL timeout seconds.
1587
+ #
1588
+ # pkg:gem/net-http#lib/net/http.rb:1564
1589
+ def ssl_timeout=(_arg0); end
1590
+
1591
+ # Sets or returns the SSL version.
1592
+ # See {OpenSSL::SSL::SSLContext#ssl_version=}[OpenSSL::SSL::SSL::Context#ssl_version=].
1593
+ #
1594
+ # pkg:gem/net-http#lib/net/http.rb:1568
1595
+ def ssl_version; end
1596
+
1597
+ # Sets or returns the SSL version.
1598
+ # See {OpenSSL::SSL::SSLContext#ssl_version=}[OpenSSL::SSL::SSL::Context#ssl_version=].
1599
+ #
1600
+ # pkg:gem/net-http#lib/net/http.rb:1568
1601
+ def ssl_version=(_arg0); end
1602
+
1603
+ # Starts an \HTTP session.
1604
+ #
1605
+ # Without a block, returns +self+:
1606
+ #
1607
+ # http = Net::HTTP.new(hostname)
1608
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
1609
+ # http.start
1610
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:80 open=true>
1611
+ # http.started? # => true
1612
+ # http.finish
1613
+ #
1614
+ # With a block, calls the block with +self+,
1615
+ # finishes the session when the block exits,
1616
+ # and returns the block's value:
1617
+ #
1618
+ # http.start do |http|
1619
+ # http
1620
+ # end
1621
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
1622
+ # http.started? # => false
1623
+ #
1624
+ # pkg:gem/net-http#lib/net/http.rb:1625
1625
+ def start; end
1626
+
1627
+ # Returns +true+ if the \HTTP session has been started:
1628
+ #
1629
+ # http = Net::HTTP.new(hostname)
1630
+ # http.started? # => false
1631
+ # http.start
1632
+ # http.started? # => true
1633
+ # http.finish # => nil
1634
+ # http.started? # => false
1635
+ #
1636
+ # Net::HTTP.start(hostname) do |http|
1637
+ # http.started?
1638
+ # end # => true
1639
+ # http.started? # => false
1640
+ #
1641
+ # pkg:gem/net-http#lib/net/http.rb:1488
1642
+ def started?; end
1643
+
1644
+ # Sends a TRACE request to the server;
1645
+ # returns an instance of a subclass of Net::HTTPResponse.
1646
+ #
1647
+ # The request is based on the Net::HTTP::Trace object
1648
+ # created from string +path+ and initial headers hash +initheader+.
1649
+ #
1650
+ # http = Net::HTTP.new(hostname)
1651
+ # http.trace('/todos/1')
1652
+ #
1653
+ # pkg:gem/net-http#lib/net/http.rb:2254
1654
+ def trace(path, initheader = T.unsafe(nil)); end
1655
+
1656
+ # Sends an UNLOCK request to the server;
1657
+ # returns an instance of a subclass of Net::HTTPResponse.
1658
+ #
1659
+ # The request is based on the Net::HTTP::Unlock object
1660
+ # created from string +path+, string +body+, and initial headers hash +initheader+.
1661
+ #
1662
+ # data = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'
1663
+ # http = Net::HTTP.new(hostname)
1664
+ # http.unlock('/todos/1', data)
1665
+ #
1666
+ # pkg:gem/net-http#lib/net/http.rb:2161
1667
+ def unlock(path, body, initheader = T.unsafe(nil)); end
1668
+
1669
+ # Sets whether a new session is to use
1670
+ # {Transport Layer Security}[https://en.wikipedia.org/wiki/Transport_Layer_Security]:
1671
+ #
1672
+ # Raises IOError if attempting to change during a session.
1673
+ #
1674
+ # Raises OpenSSL::SSL::SSLError if the port is not an HTTPS port.
1675
+ #
1676
+ # pkg:gem/net-http#lib/net/http.rb:1510
1677
+ def use_ssl=(flag); end
1678
+
1679
+ # Returns +true+ if +self+ uses SSL, +false+ otherwise.
1680
+ # See Net::HTTP#use_ssl=.
1681
+ #
1682
+ # pkg:gem/net-http#lib/net/http.rb:1500
1683
+ def use_ssl?; end
1684
+
1685
+ # Sets or returns the callback for the server certification verification.
1686
+ #
1687
+ # pkg:gem/net-http#lib/net/http.rb:1579
1688
+ def verify_callback; end
1689
+
1690
+ # Sets or returns the callback for the server certification verification.
1691
+ #
1692
+ # pkg:gem/net-http#lib/net/http.rb:1579
1693
+ def verify_callback=(_arg0); end
1694
+
1695
+ # Sets or returns the maximum depth for the certificate chain verification.
1696
+ #
1697
+ # pkg:gem/net-http#lib/net/http.rb:1582
1698
+ def verify_depth; end
1699
+
1700
+ # Sets or returns the maximum depth for the certificate chain verification.
1701
+ #
1702
+ # pkg:gem/net-http#lib/net/http.rb:1582
1703
+ def verify_depth=(_arg0); end
1704
+
1705
+ # Sets or returns whether to verify that the server certificate is valid
1706
+ # for the hostname.
1707
+ # See {OpenSSL::SSL::SSLContext#verify_hostname=}[OpenSSL::SSL::SSL::Context#verify_hostname=].
1708
+ #
1709
+ # pkg:gem/net-http#lib/net/http.rb:1592
1710
+ def verify_hostname; end
1711
+
1712
+ # Sets or returns whether to verify that the server certificate is valid
1713
+ # for the hostname.
1714
+ # See {OpenSSL::SSL::SSLContext#verify_hostname=}[OpenSSL::SSL::SSL::Context#verify_hostname=].
1715
+ #
1716
+ # pkg:gem/net-http#lib/net/http.rb:1592
1717
+ def verify_hostname=(_arg0); end
1718
+
1719
+ # Sets or returns the flags for server the certification verification
1720
+ # at the beginning of the SSL/TLS session.
1721
+ # OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER are acceptable.
1722
+ #
1723
+ # pkg:gem/net-http#lib/net/http.rb:1587
1724
+ def verify_mode; end
1725
+
1726
+ # Sets or returns the flags for server the certification verification
1727
+ # at the beginning of the SSL/TLS session.
1728
+ # OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER are acceptable.
1729
+ #
1730
+ # pkg:gem/net-http#lib/net/http.rb:1587
1731
+ def verify_mode=(_arg0); end
1732
+
1733
+ # Returns the numeric (\Integer or \Float) number of seconds
1734
+ # to wait for one block to be written (via one write(2) call);
1735
+ # see #write_timeout=.
1736
+ #
1737
+ # pkg:gem/net-http#lib/net/http.rb:1381
1738
+ def write_timeout; end
1739
+
1740
+ # Sets the write timeout, in seconds, for +self+ to integer +sec+;
1741
+ # the initial value is 60.
1742
+ #
1743
+ # Argument +sec+ must be a non-negative numeric value:
1744
+ #
1745
+ # _uri = uri.dup
1746
+ # _uri.path = '/posts'
1747
+ # body = 'bar' * 200000
1748
+ # data = <<EOF
1749
+ # {"title": "foo", "body": "#{body}", "userId": "1"}
1750
+ # EOF
1751
+ # headers = {'content-type': 'application/json'}
1752
+ # http = Net::HTTP.new(hostname)
1753
+ # http.write_timeout # => 60
1754
+ # http.post(_uri.path, data, headers)
1755
+ # # => #<Net::HTTPCreated 201 Created readbody=true>
1756
+ # http.write_timeout = 0
1757
+ # http.post(_uri.path, data, headers) # Raises Net::WriteTimeout.
1758
+ #
1759
+ # pkg:gem/net-http#lib/net/http.rb:1442
1760
+ def write_timeout=(sec); end
1761
+
1762
+ private
1763
+
1764
+ # pkg:gem/net-http#lib/net/http.rb:2587
1765
+ def D(msg); end
1766
+
1767
+ # pkg:gem/net-http#lib/net/http.rb:2573
1768
+ def addr_port; end
1769
+
1770
+ # pkg:gem/net-http#lib/net/http.rb:2490
1771
+ def begin_transport(req); end
1772
+
1773
+ # without proxy, obsolete
1774
+ #
1775
+ # pkg:gem/net-http#lib/net/http.rb:1957
1776
+ def conn_address; end
1777
+
1778
+ # pkg:gem/net-http#lib/net/http.rb:1961
1779
+ def conn_port; end
1780
+
1781
+ # pkg:gem/net-http#lib/net/http.rb:1660
1782
+ def connect; end
1783
+
1784
+ # Adds a message to debugging output
1785
+ #
1786
+ # pkg:gem/net-http#lib/net/http.rb:2581
1787
+ def debug(msg); end
1788
+
1789
+ # pkg:gem/net-http#lib/net/http.rb:1802
1790
+ def do_finish; end
1791
+
1792
+ # :stopdoc:
1793
+ #
1794
+ # pkg:gem/net-http#lib/net/http.rb:1654
1795
+ def do_start; end
1796
+
1797
+ # pkg:gem/net-http#lib/net/http.rb:1965
1798
+ def edit_path(path); end
1799
+
1800
+ # pkg:gem/net-http#lib/net/http.rb:2513
1801
+ def end_transport(req, res); end
1802
+
1803
+ # pkg:gem/net-http#lib/net/http.rb:2530
1804
+ def keep_alive?(req, res); end
1805
+
1806
+ # pkg:gem/net-http#lib/net/http.rb:1798
1807
+ def on_connect; end
1808
+
1809
+ # Executes a request which uses a representation
1810
+ # and returns its body.
1811
+ #
1812
+ # pkg:gem/net-http#lib/net/http.rb:2422
1813
+ def send_entity(path, data, initheader, dest, type, &block); end
1814
+
1815
+ # pkg:gem/net-http#lib/net/http.rb:2554
1816
+ def sspi_auth(req); end
1817
+
1818
+ # pkg:gem/net-http#lib/net/http.rb:2539
1819
+ def sspi_auth?(res); end
1820
+
1821
+ # pkg:gem/net-http#lib/net/http.rb:1787
1822
+ def timeouted_connect(conn_addr, conn_port); end
1823
+
1824
+ # pkg:gem/net-http#lib/net/http.rb:2435
1825
+ def transport_request(req); end
1826
+
1827
+ # :stopdoc:
1828
+ #
1829
+ # pkg:gem/net-http#lib/net/http.rb:1949
1830
+ def unescape(value); end
1831
+
1832
+ class << self
1833
+ # Creates an \HTTP proxy class which behaves like \Net::HTTP, but
1834
+ # performs all access via the specified proxy.
1835
+ #
1836
+ # This class is obsolete. You may pass these same parameters directly to
1837
+ # \Net::HTTP.new. See Net::HTTP.new for details of the arguments.
1838
+ #
1839
+ # pkg:gem/net-http#lib/net/http.rb:1829
1840
+ def Proxy(p_addr = T.unsafe(nil), p_port = T.unsafe(nil), p_user = T.unsafe(nil), p_pass = T.unsafe(nil), p_use_ssl = T.unsafe(nil)); end
1841
+
1842
+ # Allows to set the default configuration that will be used
1843
+ # when creating a new connection.
1844
+ #
1845
+ # Example:
1846
+ #
1847
+ # Net::HTTP.default_configuration = {
1848
+ # read_timeout: 1,
1849
+ # write_timeout: 1
1850
+ # }
1851
+ # http = Net::HTTP.new(hostname)
1852
+ # http.open_timeout # => 60
1853
+ # http.read_timeout # => 1
1854
+ # http.write_timeout # => 1
1855
+ #
1856
+ # pkg:gem/net-http#lib/net/http.rb:1142
1857
+ def default_configuration; end
1858
+
1859
+ # Allows to set the default configuration that will be used
1860
+ # when creating a new connection.
1861
+ #
1862
+ # Example:
1863
+ #
1864
+ # Net::HTTP.default_configuration = {
1865
+ # read_timeout: 1,
1866
+ # write_timeout: 1
1867
+ # }
1868
+ # http = Net::HTTP.new(hostname)
1869
+ # http.open_timeout # => 60
1870
+ # http.read_timeout # => 1
1871
+ # http.write_timeout # => 1
1872
+ #
1873
+ # pkg:gem/net-http#lib/net/http.rb:1142
1874
+ def default_configuration=(_arg0); end
1875
+
1876
+ # Returns integer +80+, the default port to use for \HTTP requests:
1877
+ #
1878
+ # Net::HTTP.default_port # => 80
1879
+ #
1880
+ # pkg:gem/net-http#lib/net/http.rb:935
1881
+ def default_port; end
1882
+
1883
+ # :call-seq:
1884
+ # Net::HTTP.get(hostname, path, port = 80) -> body
1885
+ # Net::HTTP:get(uri, headers = {}, port = uri.port) -> body
1886
+ #
1887
+ # Sends a GET request and returns the \HTTP response body as a string.
1888
+ #
1889
+ # With string arguments +hostname+ and +path+:
1890
+ #
1891
+ # hostname = 'jsonplaceholder.typicode.com'
1892
+ # path = '/todos/1'
1893
+ # puts Net::HTTP.get(hostname, path)
1894
+ #
1895
+ # Output:
1896
+ #
1897
+ # {
1898
+ # "userId": 1,
1899
+ # "id": 1,
1900
+ # "title": "delectus aut autem",
1901
+ # "completed": false
1902
+ # }
1903
+ #
1904
+ # With URI object +uri+ and optional hash argument +headers+:
1905
+ #
1906
+ # uri = URI('https://jsonplaceholder.typicode.com/todos/1')
1907
+ # headers = {'Content-type' => 'application/json; charset=UTF-8'}
1908
+ # Net::HTTP.get(uri, headers)
1909
+ #
1910
+ # Related:
1911
+ #
1912
+ # - Net::HTTP::Get: request class for \HTTP method +GET+.
1913
+ # - Net::HTTP#get: convenience method for \HTTP method +GET+.
1914
+ #
1915
+ # pkg:gem/net-http#lib/net/http.rb:804
1916
+ def get(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil)); end
1917
+
1918
+ # :call-seq:
1919
+ # Net::HTTP.get_print(hostname, path, port = 80) -> nil
1920
+ # Net::HTTP:get_print(uri, headers = {}, port = uri.port) -> nil
1921
+ #
1922
+ # Like Net::HTTP.get, but writes the returned body to $stdout;
1923
+ # returns +nil+.
1924
+ #
1925
+ # pkg:gem/net-http#lib/net/http.rb:763
1926
+ def get_print(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil)); end
1927
+
1928
+ # :call-seq:
1929
+ # Net::HTTP.get_response(hostname, path, port = 80) -> http_response
1930
+ # Net::HTTP:get_response(uri, headers = {}, port = uri.port) -> http_response
1931
+ #
1932
+ # Like Net::HTTP.get, but returns a Net::HTTPResponse object
1933
+ # instead of the body string.
1934
+ #
1935
+ # pkg:gem/net-http#lib/net/http.rb:814
1936
+ def get_response(uri_or_host, path_or_headers = T.unsafe(nil), port = T.unsafe(nil), &block); end
1937
+
1938
+ # Returns integer +80+, the default port to use for \HTTP requests:
1939
+ #
1940
+ # Net::HTTP.http_default_port # => 80
1941
+ #
1942
+ # pkg:gem/net-http#lib/net/http.rb:943
1943
+ def http_default_port; end
1944
+
1945
+ # Returns integer +443+, the default port to use for HTTPS requests:
1946
+ #
1947
+ # Net::HTTP.https_default_port # => 443
1948
+ #
1949
+ # pkg:gem/net-http#lib/net/http.rb:951
1950
+ def https_default_port; end
1951
+
1952
+ # pkg:gem/net-http#lib/net/http.rb:753
1953
+ def is_version_1_1?; end
1954
+
1955
+ # pkg:gem/net-http#lib/net/http.rb:754
1956
+ def is_version_1_2?; end
1957
+
1958
+ # Returns a new \Net::HTTP object +http+
1959
+ # (but does not open a TCP connection or \HTTP session).
1960
+ #
1961
+ # With only string argument +address+ given
1962
+ # (and <tt>ENV['http_proxy']</tt> undefined or +nil+),
1963
+ # the returned +http+:
1964
+ #
1965
+ # - Has the given address.
1966
+ # - Has the default port number, Net::HTTP.default_port (80).
1967
+ # - Has no proxy.
1968
+ #
1969
+ # Example:
1970
+ #
1971
+ # http = Net::HTTP.new(hostname)
1972
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:80 open=false>
1973
+ # http.address # => "jsonplaceholder.typicode.com"
1974
+ # http.port # => 80
1975
+ # http.proxy? # => false
1976
+ #
1977
+ # With integer argument +port+ also given,
1978
+ # the returned +http+ has the given port:
1979
+ #
1980
+ # http = Net::HTTP.new(hostname, 8000)
1981
+ # # => #<Net::HTTP jsonplaceholder.typicode.com:8000 open=false>
1982
+ # http.port # => 8000
1983
+ #
1984
+ # For proxy-defining arguments +p_addr+ through +p_no_proxy+,
1985
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
1986
+ #
1987
+ # pkg:gem/net-http#lib/net/http.rb:1100
1988
+ def new(address, port = T.unsafe(nil), p_addr = T.unsafe(nil), p_port = T.unsafe(nil), p_user = T.unsafe(nil), p_pass = T.unsafe(nil), p_no_proxy = T.unsafe(nil), p_use_ssl = T.unsafe(nil)); end
1989
+
1990
+ # pkg:gem/net-http#lib/net/http.rb:1068
1991
+ def newobj(*_arg0); end
1992
+
1993
+ # Posts data to a host; returns a Net::HTTPResponse object.
1994
+ #
1995
+ # Argument +url+ must be a URL;
1996
+ # argument +data+ must be a string:
1997
+ #
1998
+ # _uri = uri.dup
1999
+ # _uri.path = '/posts'
2000
+ # data = '{"title": "foo", "body": "bar", "userId": 1}'
2001
+ # headers = {'content-type': 'application/json'}
2002
+ # res = Net::HTTP.post(_uri, data, headers) # => #<Net::HTTPCreated 201 Created readbody=true>
2003
+ # puts res.body
2004
+ #
2005
+ # Output:
2006
+ #
2007
+ # {
2008
+ # "title": "foo",
2009
+ # "body": "bar",
2010
+ # "userId": 1,
2011
+ # "id": 101
2012
+ # }
2013
+ #
2014
+ # Related:
2015
+ #
2016
+ # - Net::HTTP::Post: request class for \HTTP method +POST+.
2017
+ # - Net::HTTP#post: convenience method for \HTTP method +POST+.
2018
+ #
2019
+ # pkg:gem/net-http#lib/net/http.rb:857
2020
+ def post(url, data, header = T.unsafe(nil)); end
2021
+
2022
+ # Posts data to a host; returns a Net::HTTPResponse object.
2023
+ #
2024
+ # Argument +url+ must be a URI;
2025
+ # argument +data+ must be a hash:
2026
+ #
2027
+ # _uri = uri.dup
2028
+ # _uri.path = '/posts'
2029
+ # data = {title: 'foo', body: 'bar', userId: 1}
2030
+ # res = Net::HTTP.post_form(_uri, data) # => #<Net::HTTPCreated 201 Created readbody=true>
2031
+ # puts res.body
2032
+ #
2033
+ # Output:
2034
+ #
2035
+ # {
2036
+ # "title": "foo",
2037
+ # "body": "bar",
2038
+ # "userId": "1",
2039
+ # "id": 101
2040
+ # }
2041
+ #
2042
+ # pkg:gem/net-http#lib/net/http.rb:884
2043
+ def post_form(url, params); end
2044
+
2045
+ # Returns the address of the proxy host, or +nil+ if none;
2046
+ # see Net::HTTP@Proxy+Server.
2047
+ #
2048
+ # pkg:gem/net-http#lib/net/http.rb:1861
2049
+ def proxy_address; end
2050
+
2051
+ # Returns true if self is a class which was created by HTTP::Proxy.
2052
+ #
2053
+ # pkg:gem/net-http#lib/net/http.rb:1855
2054
+ def proxy_class?; end
2055
+
2056
+ # Returns the password for accessing the proxy, or +nil+ if none;
2057
+ # see Net::HTTP@Proxy+Server.
2058
+ #
2059
+ # pkg:gem/net-http#lib/net/http.rb:1873
2060
+ def proxy_pass; end
2061
+
2062
+ # Returns the port number of the proxy host, or +nil+ if none;
2063
+ # see Net::HTTP@Proxy+Server.
2064
+ #
2065
+ # pkg:gem/net-http#lib/net/http.rb:1865
2066
+ def proxy_port; end
2067
+
2068
+ # Use SSL when talking to the proxy. If Net::HTTP does not use a proxy, nil.
2069
+ #
2070
+ # pkg:gem/net-http#lib/net/http.rb:1876
2071
+ def proxy_use_ssl; end
2072
+
2073
+ # Returns the user name for accessing the proxy, or +nil+ if none;
2074
+ # see Net::HTTP@Proxy+Server.
2075
+ #
2076
+ # pkg:gem/net-http#lib/net/http.rb:1869
2077
+ def proxy_user; end
2078
+
2079
+ # Sends a PUT request to the server; returns a Net::HTTPResponse object.
2080
+ #
2081
+ # Argument +url+ must be a URL;
2082
+ # argument +data+ must be a string:
2083
+ #
2084
+ # _uri = uri.dup
2085
+ # _uri.path = '/posts'
2086
+ # data = '{"title": "foo", "body": "bar", "userId": 1}'
2087
+ # headers = {'content-type': 'application/json'}
2088
+ # res = Net::HTTP.put(_uri, data, headers) # => #<Net::HTTPCreated 201 Created readbody=true>
2089
+ # puts res.body
2090
+ #
2091
+ # Output:
2092
+ #
2093
+ # {
2094
+ # "title": "foo",
2095
+ # "body": "bar",
2096
+ # "userId": 1,
2097
+ # "id": 101
2098
+ # }
2099
+ #
2100
+ # Related:
2101
+ #
2102
+ # - Net::HTTP::Put: request class for \HTTP method +PUT+.
2103
+ # - Net::HTTP#put: convenience method for \HTTP method +PUT+.
2104
+ #
2105
+ # pkg:gem/net-http#lib/net/http.rb:920
2106
+ def put(url, data, header = T.unsafe(nil)); end
2107
+
2108
+ # pkg:gem/net-http#lib/net/http.rb:955
2109
+ def socket_type; end
2110
+
2111
+ # :call-seq:
2112
+ # HTTP.start(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, opts) -> http
2113
+ # HTTP.start(address, port = nil, p_addr = :ENV, p_port = nil, p_user = nil, p_pass = nil, opts) {|http| ... } -> object
2114
+ #
2115
+ # Creates a new \Net::HTTP object, +http+, via \Net::HTTP.new:
2116
+ #
2117
+ # - For arguments +address+ and +port+, see Net::HTTP.new.
2118
+ # - For proxy-defining arguments +p_addr+ through +p_pass+,
2119
+ # see {Proxy Server}[rdoc-ref:Net::HTTP@Proxy+Server].
2120
+ # - For argument +opts+, see below.
2121
+ #
2122
+ # With no block given:
2123
+ #
2124
+ # - Calls <tt>http.start</tt> with no block (see #start),
2125
+ # which opens a TCP connection and \HTTP session.
2126
+ # - Returns +http+.
2127
+ # - The caller should call #finish to close the session:
2128
+ #
2129
+ # http = Net::HTTP.start(hostname)
2130
+ # http.started? # => true
2131
+ # http.finish
2132
+ # http.started? # => false
2133
+ #
2134
+ # With a block given:
2135
+ #
2136
+ # - Calls <tt>http.start</tt> with the block (see #start), which:
2137
+ #
2138
+ # - Opens a TCP connection and \HTTP session.
2139
+ # - Calls the block,
2140
+ # which may make any number of requests to the host.
2141
+ # - Closes the \HTTP session and TCP connection on block exit.
2142
+ # - Returns the block's value +object+.
2143
+ #
2144
+ # - Returns +object+.
2145
+ #
2146
+ # Example:
2147
+ #
2148
+ # hostname = 'jsonplaceholder.typicode.com'
2149
+ # Net::HTTP.start(hostname) do |http|
2150
+ # puts http.get('/todos/1').body
2151
+ # puts http.get('/todos/2').body
2152
+ # end
2153
+ #
2154
+ # Output:
2155
+ #
2156
+ # {
2157
+ # "userId": 1,
2158
+ # "id": 1,
2159
+ # "title": "delectus aut autem",
2160
+ # "completed": false
2161
+ # }
2162
+ # {
2163
+ # "userId": 1,
2164
+ # "id": 2,
2165
+ # "title": "quis ut nam facilis et officia qui",
2166
+ # "completed": false
2167
+ # }
2168
+ #
2169
+ # If the last argument given is a hash, it is the +opts+ hash,
2170
+ # where each key is a method or accessor to be called,
2171
+ # and its value is the value to be set.
2172
+ #
2173
+ # The keys may include:
2174
+ #
2175
+ # - #ca_file
2176
+ # - #ca_path
2177
+ # - #cert
2178
+ # - #cert_store
2179
+ # - #ciphers
2180
+ # - #close_on_empty_response
2181
+ # - +ipaddr+ (calls #ipaddr=)
2182
+ # - #keep_alive_timeout
2183
+ # - #key
2184
+ # - #open_timeout
2185
+ # - #read_timeout
2186
+ # - #ssl_timeout
2187
+ # - #ssl_version
2188
+ # - +use_ssl+ (calls #use_ssl=)
2189
+ # - #verify_callback
2190
+ # - #verify_depth
2191
+ # - #verify_mode
2192
+ # - #write_timeout
2193
+ #
2194
+ # Note: If +port+ is +nil+ and <tt>opts[:use_ssl]</tt> is a truthy value,
2195
+ # the value passed to +new+ is Net::HTTP.https_default_port, not +port+.
2196
+ #
2197
+ # pkg:gem/net-http#lib/net/http.rb:1045
2198
+ def start(address, *arg, &block); end
2199
+
2200
+ # Returns +false+; retained for compatibility.
2201
+ #
2202
+ # pkg:gem/net-http#lib/net/http.rb:748
2203
+ def version_1_1?; end
2204
+
2205
+ # Returns +true+; retained for compatibility.
2206
+ #
2207
+ # pkg:gem/net-http#lib/net/http.rb:738
2208
+ def version_1_2; end
2209
+
2210
+ # Returns +true+; retained for compatibility.
2211
+ #
2212
+ # pkg:gem/net-http#lib/net/http.rb:743
2213
+ def version_1_2?; end
2214
+ end
2215
+ end
2216
+
2217
+ # pkg:gem/net-http#lib/net/http/proxy_delta.rb:2
2218
+ module Net::HTTP::ProxyDelta
2219
+ private
2220
+
2221
+ # pkg:gem/net-http#lib/net/http/proxy_delta.rb:5
2222
+ def conn_address; end
2223
+
2224
+ # pkg:gem/net-http#lib/net/http/proxy_delta.rb:9
2225
+ def conn_port; end
2226
+
2227
+ # pkg:gem/net-http#lib/net/http/proxy_delta.rb:13
2228
+ def edit_path(path); end
2229
+ end
2230
+
2231
+ # pkg:gem/net-http#lib/net/http.rb:1778
2232
+ Net::HTTP::TCP_SOCKET_NEW_HAS_OPEN_TIMEOUT = T.let(T.unsafe(nil), FalseClass)
2233
+
2234
+ # :stopdoc:
2235
+ #
2236
+ # pkg:gem/net-http#lib/net/http.rb:727
2237
+ Net::HTTP::VERSION = T.let(T.unsafe(nil), String)
2238
+
2239
+ # Response class for <tt>Already Reported (WebDAV)</tt> responses (status code 208).
2240
+ #
2241
+ # The <tt>Already Reported (WebDAV)</tt> response indicates that the server
2242
+ # has received the request,
2243
+ # and that the members of a DAV binding have already been enumerated
2244
+ # in a preceding part of the (multi-status) response,
2245
+ # and are not being included again.
2246
+ #
2247
+ # :include: doc/net-http/included_getters.rdoc
2248
+ #
2249
+ # References:
2250
+ #
2251
+ # - {RFC 5842}[https://www.rfc-editor.org/rfc/rfc5842.html#section-7.1].
2252
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#208].
2253
+ #
2254
+ # pkg:gem/net-http#lib/net/http/responses.rb:325
2255
+ class Net::HTTPAlreadyReported < ::Net::HTTPSuccess; end
2256
+
2257
+ # :stopdoc:
2258
+ #
2259
+ # pkg:gem/net-http#lib/net/http/responses.rb:327
2260
+ Net::HTTPAlreadyReported::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
2261
+
2262
+ # pkg:gem/net-http#lib/net/http/responses.rb:73
2263
+ Net::HTTPClientError::EXCEPTION_TYPE = Net::HTTPClientException
2264
+
2265
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:24
2266
+ class Net::HTTPClientException < ::Net::ProtoServerError
2267
+ include ::Net::HTTPExceptions
2268
+ end
2269
+
2270
+ # Response class for <tt>Early Hints</tt> responses (status code 103).
2271
+ #
2272
+ # The <tt>Early Hints</tt> indicates that the server has received
2273
+ # and is processing the request, and contains certain headers;
2274
+ # the final response is not available yet.
2275
+ #
2276
+ # :include: doc/net-http/included_getters.rdoc
2277
+ #
2278
+ # References:
2279
+ #
2280
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103].
2281
+ # - {RFC 8297}[https://www.rfc-editor.org/rfc/rfc8297.html#section-2].
2282
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#103].
2283
+ #
2284
+ # pkg:gem/net-http#lib/net/http/responses.rb:157
2285
+ class Net::HTTPEarlyHints < ::Net::HTTPInformation; end
2286
+
2287
+ # :stopdoc:
2288
+ #
2289
+ # pkg:gem/net-http#lib/net/http/responses.rb:159
2290
+ Net::HTTPEarlyHints::HAS_BODY = T.let(T.unsafe(nil), FalseClass)
2291
+
2292
+ # :stopdoc:
2293
+ #
2294
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:16
2295
+ class Net::HTTPError < ::Net::ProtocolError
2296
+ include ::Net::HTTPExceptions
2297
+ end
2298
+
2299
+ # Net::HTTP exception class.
2300
+ # You cannot use Net::HTTPExceptions directly; instead, you must use
2301
+ # its subclasses.
2302
+ #
2303
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:6
2304
+ module Net::HTTPExceptions
2305
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:7
2306
+ def initialize(msg, res); end
2307
+
2308
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:12
2309
+ def data; end
2310
+
2311
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:11
2312
+ def response; end
2313
+ end
2314
+
2315
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:28
2316
+ class Net::HTTPFatalError < ::Net::ProtoFatalError
2317
+ include ::Net::HTTPExceptions
2318
+ end
2319
+
2320
+ # \HTTPGenericRequest is the parent of the Net::HTTPRequest class.
2321
+ #
2322
+ # Do not use this directly; instead, use a subclass of Net::HTTPRequest.
2323
+ #
2324
+ # == About the Examples
2325
+ #
2326
+ # :include: doc/net-http/examples.rdoc
2327
+ #
2328
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:11
2329
+ class Net::HTTPGenericRequest
2330
+ include ::Net::HTTPHeader
2331
+
2332
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:15
2333
+ def initialize(m, reqbody, resbody, uri_or_path, initheader = T.unsafe(nil)); end
2334
+
2335
+ # Don't automatically decode response content-encoding if the user indicates
2336
+ # they want to handle it.
2337
+ #
2338
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:131
2339
+ def []=(key, val); end
2340
+
2341
+ # Returns the string body for the request, or +nil+ if there is none:
2342
+ #
2343
+ # req = Net::HTTP::Post.new(uri)
2344
+ # req.body # => nil
2345
+ # req.body = '{"title": "foo","body": "bar","userId": 1}'
2346
+ # req.body # => "{\"title\": \"foo\",\"body\": \"bar\",\"userId\": 1}"
2347
+ #
2348
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:167
2349
+ def body; end
2350
+
2351
+ # Sets the body for the request:
2352
+ #
2353
+ # req = Net::HTTP::Post.new(uri)
2354
+ # req.body # => nil
2355
+ # req.body = '{"title": "foo","body": "bar","userId": 1}'
2356
+ # req.body # => "{\"title\": \"foo\",\"body\": \"bar\",\"userId\": 1}"
2357
+ #
2358
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:176
2359
+ def body=(str); end
2360
+
2361
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:155
2362
+ def body_exist?; end
2363
+
2364
+ # Returns the body stream object for the request, or +nil+ if there is none:
2365
+ #
2366
+ # req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST>
2367
+ # req.body_stream # => nil
2368
+ # require 'stringio'
2369
+ # req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8>
2370
+ # req.body_stream # => #<StringIO:0x0000027d1e5affa8>
2371
+ #
2372
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:191
2373
+ def body_stream; end
2374
+
2375
+ # Sets the body stream for the request:
2376
+ #
2377
+ # req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST>
2378
+ # req.body_stream # => nil
2379
+ # require 'stringio'
2380
+ # req.body_stream = StringIO.new('xyzzy') # => #<StringIO:0x0000027d1e5affa8>
2381
+ # req.body_stream # => #<StringIO:0x0000027d1e5affa8>
2382
+ #
2383
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:201
2384
+ def body_stream=(input); end
2385
+
2386
+ # Returns +false+ if the request's header <tt>'Accept-Encoding'</tt>
2387
+ # has been set manually or deleted
2388
+ # (indicating that the user intends to handle encoding in the response),
2389
+ # +true+ otherwise:
2390
+ #
2391
+ # req = Net::HTTP::Get.new(uri) # => #<Net::HTTP::Get GET>
2392
+ # req['Accept-Encoding'] # => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3"
2393
+ # req.decode_content # => true
2394
+ # req['Accept-Encoding'] = 'foo'
2395
+ # req.decode_content # => false
2396
+ # req.delete('Accept-Encoding')
2397
+ # req.decode_content # => false
2398
+ #
2399
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:92
2400
+ def decode_content; end
2401
+
2402
+ # write
2403
+ #
2404
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:220
2405
+ def exec(sock, ver, path); end
2406
+
2407
+ # Returns a string representation of the request:
2408
+ #
2409
+ # Net::HTTP::Post.new(uri).inspect # => "#<Net::HTTP::Post POST>"
2410
+ #
2411
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:98
2412
+ def inspect; end
2413
+
2414
+ # Returns the string method name for the request:
2415
+ #
2416
+ # Net::HTTP::Get.new(uri).method # => "GET"
2417
+ # Net::HTTP::Post.new(uri).method # => "POST"
2418
+ #
2419
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:62
2420
+ def method; end
2421
+
2422
+ # Returns the string path for the request:
2423
+ #
2424
+ # Net::HTTP::Get.new(uri).path # => "/"
2425
+ # Net::HTTP::Post.new('example.com').path # => "example.com"
2426
+ #
2427
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:69
2428
+ def path; end
2429
+
2430
+ # Returns a string representation of the request with the details for pp:
2431
+ #
2432
+ # require 'pp'
2433
+ # post = Net::HTTP::Post.new(uri)
2434
+ # post.inspect # => "#<Net::HTTP::Post POST>"
2435
+ # post.pretty_inspect
2436
+ # # => #<Net::HTTP::Post
2437
+ # POST
2438
+ # path="/"
2439
+ # headers={"accept-encoding" => ["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
2440
+ # "accept" => ["*/*"],
2441
+ # "user-agent" => ["Ruby"],
2442
+ # "host" => ["www.ruby-lang.org"]}>
2443
+ #
2444
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:116
2445
+ def pretty_print(q); end
2446
+
2447
+ # Returns whether the request may have a body:
2448
+ #
2449
+ # Net::HTTP::Post.new(uri).request_body_permitted? # => true
2450
+ # Net::HTTP::Get.new(uri).request_body_permitted? # => false
2451
+ #
2452
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:142
2453
+ def request_body_permitted?; end
2454
+
2455
+ # Returns whether the response may have a body:
2456
+ #
2457
+ # Net::HTTP::Post.new(uri).response_body_permitted? # => true
2458
+ # Net::HTTP::Head.new(uri).response_body_permitted? # => false
2459
+ #
2460
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:151
2461
+ def response_body_permitted?; end
2462
+
2463
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:208
2464
+ def set_body_internal(str); end
2465
+
2466
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:232
2467
+ def update_uri(addr, port, ssl); end
2468
+
2469
+ # Returns the URI object for the request, or +nil+ if none:
2470
+ #
2471
+ # Net::HTTP::Get.new(uri).uri
2472
+ # # => #<URI::HTTPS https://jsonplaceholder.typicode.com/>
2473
+ # Net::HTTP::Get.new('example.com').uri # => nil
2474
+ #
2475
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:77
2476
+ def uri; end
2477
+
2478
+ private
2479
+
2480
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:334
2481
+ def encode_multipart_form_data(out, params, opt); end
2482
+
2483
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:390
2484
+ def flush_buffer(out, buf, chunked_p); end
2485
+
2486
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:385
2487
+ def quote_string(str, charset); end
2488
+
2489
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:284
2490
+ def send_request_with_body(sock, ver, path, body); end
2491
+
2492
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:308
2493
+ def send_request_with_body_data(sock, ver, path, params); end
2494
+
2495
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:292
2496
+ def send_request_with_body_stream(sock, ver, path, f); end
2497
+
2498
+ # Waits up to the continue timeout for a response from the server provided
2499
+ # we're speaking HTTP 1.1 and are expecting a 100-continue response.
2500
+ #
2501
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:402
2502
+ def wait_for_continue(sock, ver); end
2503
+
2504
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:415
2505
+ def write_header(sock, ver, path); end
2506
+ end
2507
+
2508
+ # :stopdoc:
2509
+ #
2510
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:266
2511
+ class Net::HTTPGenericRequest::Chunker
2512
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:267
2513
+ def initialize(sock); end
2514
+
2515
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:279
2516
+ def finish; end
2517
+
2518
+ # pkg:gem/net-http#lib/net/http/generic_request.rb:272
2519
+ def write(buf); end
2520
+ end
2521
+
2522
+ # The \HTTPHeader module provides access to \HTTP headers.
2523
+ #
2524
+ # The module is included in:
2525
+ #
2526
+ # - Net::HTTPGenericRequest (and therefore Net::HTTPRequest).
2527
+ # - Net::HTTPResponse.
2528
+ #
2529
+ # The headers are a hash-like collection of key/value pairs called _fields_.
2530
+ #
2531
+ # == Request and Response Fields
2532
+ #
2533
+ # Headers may be included in:
2534
+ #
2535
+ # - A Net::HTTPRequest object:
2536
+ # the object's headers will be sent with the request.
2537
+ # Any fields may be defined in the request;
2538
+ # see {Setters}[rdoc-ref:Net::HTTPHeader@Setters].
2539
+ # - A Net::HTTPResponse object:
2540
+ # the objects headers are usually those returned from the host.
2541
+ # Fields may be retrieved from the object;
2542
+ # see {Getters}[rdoc-ref:Net::HTTPHeader@Getters]
2543
+ # and {Iterators}[rdoc-ref:Net::HTTPHeader@Iterators].
2544
+ #
2545
+ # Exactly which fields should be sent or expected depends on the host;
2546
+ # see:
2547
+ #
2548
+ # - {Request fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields].
2549
+ # - {Response fields}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields].
2550
+ #
2551
+ # == About the Examples
2552
+ #
2553
+ # :include: doc/net-http/examples.rdoc
2554
+ #
2555
+ # == Fields
2556
+ #
2557
+ # A header field is a key/value pair.
2558
+ #
2559
+ # === Field Keys
2560
+ #
2561
+ # A field key may be:
2562
+ #
2563
+ # - A string: Key <tt>'Accept'</tt> is treated as if it were
2564
+ # <tt>'Accept'.downcase</tt>; i.e., <tt>'accept'</tt>.
2565
+ # - A symbol: Key <tt>:Accept</tt> is treated as if it were
2566
+ # <tt>:Accept.to_s.downcase</tt>; i.e., <tt>'accept'</tt>.
2567
+ #
2568
+ # Examples:
2569
+ #
2570
+ # req = Net::HTTP::Get.new(uri)
2571
+ # req[:accept] # => "*/*"
2572
+ # req['Accept'] # => "*/*"
2573
+ # req['ACCEPT'] # => "*/*"
2574
+ #
2575
+ # req['accept'] = 'text/html'
2576
+ # req[:accept] = 'text/html'
2577
+ # req['ACCEPT'] = 'text/html'
2578
+ #
2579
+ # === Field Values
2580
+ #
2581
+ # A field value may be returned as an array of strings or as a string:
2582
+ #
2583
+ # - These methods return field values as arrays:
2584
+ #
2585
+ # - #get_fields: Returns the array value for the given key,
2586
+ # or +nil+ if it does not exist.
2587
+ # - #to_hash: Returns a hash of all header fields:
2588
+ # each key is a field name; its value is the array value for the field.
2589
+ #
2590
+ # - These methods return field values as string;
2591
+ # the string value for a field is equivalent to
2592
+ # <tt>self[key.downcase.to_s].join(', '))</tt>:
2593
+ #
2594
+ # - #[]: Returns the string value for the given key,
2595
+ # or +nil+ if it does not exist.
2596
+ # - #fetch: Like #[], but accepts a default value
2597
+ # to be returned if the key does not exist.
2598
+ #
2599
+ # The field value may be set:
2600
+ #
2601
+ # - #[]=: Sets the value for the given key;
2602
+ # the given value may be a string, a symbol, an array, or a hash.
2603
+ # - #add_field: Adds a given value to a value for the given key
2604
+ # (not overwriting the existing value).
2605
+ # - #delete: Deletes the field for the given key.
2606
+ #
2607
+ # Example field values:
2608
+ #
2609
+ # - \String:
2610
+ #
2611
+ # req['Accept'] = 'text/html' # => "text/html"
2612
+ # req['Accept'] # => "text/html"
2613
+ # req.get_fields('Accept') # => ["text/html"]
2614
+ #
2615
+ # - \Symbol:
2616
+ #
2617
+ # req['Accept'] = :text # => :text
2618
+ # req['Accept'] # => "text"
2619
+ # req.get_fields('Accept') # => ["text"]
2620
+ #
2621
+ # - Simple array:
2622
+ #
2623
+ # req[:foo] = %w[bar baz bat]
2624
+ # req[:foo] # => "bar, baz, bat"
2625
+ # req.get_fields(:foo) # => ["bar", "baz", "bat"]
2626
+ #
2627
+ # - Simple hash:
2628
+ #
2629
+ # req[:foo] = {bar: 0, baz: 1, bat: 2}
2630
+ # req[:foo] # => "bar, 0, baz, 1, bat, 2"
2631
+ # req.get_fields(:foo) # => ["bar", "0", "baz", "1", "bat", "2"]
2632
+ #
2633
+ # - Nested:
2634
+ #
2635
+ # req[:foo] = [%w[bar baz], {bat: 0, bam: 1}]
2636
+ # req[:foo] # => "bar, baz, bat, 0, bam, 1"
2637
+ # req.get_fields(:foo) # => ["bar", "baz", "bat", "0", "bam", "1"]
2638
+ #
2639
+ # req[:foo] = {bar: %w[baz bat], bam: {bah: 0, bad: 1}}
2640
+ # req[:foo] # => "bar, baz, bat, bam, bah, 0, bad, 1"
2641
+ # req.get_fields(:foo) # => ["bar", "baz", "bat", "bam", "bah", "0", "bad", "1"]
2642
+ #
2643
+ # == Convenience Methods
2644
+ #
2645
+ # Various convenience methods retrieve values, set values, query values,
2646
+ # set form values, or iterate over fields.
2647
+ #
2648
+ # === Setters
2649
+ #
2650
+ # \Method #[]= can set any field, but does little to validate the new value;
2651
+ # some of the other setter methods provide some validation:
2652
+ #
2653
+ # - #[]=: Sets the string or array value for the given key.
2654
+ # - #add_field: Creates or adds to the array value for the given key.
2655
+ # - #basic_auth: Sets the string authorization header for <tt>'Authorization'</tt>.
2656
+ # - #content_length=: Sets the integer length for field <tt>'Content-Length</tt>.
2657
+ # - #content_type=: Sets the string value for field <tt>'Content-Type'</tt>.
2658
+ # - #proxy_basic_auth: Sets the string authorization header for <tt>'Proxy-Authorization'</tt>.
2659
+ # - #set_range: Sets the value for field <tt>'Range'</tt>.
2660
+ #
2661
+ # === Form Setters
2662
+ #
2663
+ # - #set_form: Sets an HTML form data set.
2664
+ # - #set_form_data: Sets header fields and a body from HTML form data.
2665
+ #
2666
+ # === Getters
2667
+ #
2668
+ # \Method #[] can retrieve the value of any field that exists,
2669
+ # but always as a string;
2670
+ # some of the other getter methods return something different
2671
+ # from the simple string value:
2672
+ #
2673
+ # - #[]: Returns the string field value for the given key.
2674
+ # - #content_length: Returns the integer value of field <tt>'Content-Length'</tt>.
2675
+ # - #content_range: Returns the Range value of field <tt>'Content-Range'</tt>.
2676
+ # - #content_type: Returns the string value of field <tt>'Content-Type'</tt>.
2677
+ # - #fetch: Returns the string field value for the given key.
2678
+ # - #get_fields: Returns the array field value for the given +key+.
2679
+ # - #main_type: Returns first part of the string value of field <tt>'Content-Type'</tt>.
2680
+ # - #sub_type: Returns second part of the string value of field <tt>'Content-Type'</tt>.
2681
+ # - #range: Returns an array of Range objects of field <tt>'Range'</tt>, or +nil+.
2682
+ # - #range_length: Returns the integer length of the range given in field <tt>'Content-Range'</tt>.
2683
+ # - #type_params: Returns the string parameters for <tt>'Content-Type'</tt>.
2684
+ #
2685
+ # === Queries
2686
+ #
2687
+ # - #chunked?: Returns whether field <tt>'Transfer-Encoding'</tt> is set to <tt>'chunked'</tt>.
2688
+ # - #connection_close?: Returns whether field <tt>'Connection'</tt> is set to <tt>'close'</tt>.
2689
+ # - #connection_keep_alive?: Returns whether field <tt>'Connection'</tt> is set to <tt>'keep-alive'</tt>.
2690
+ # - #key?: Returns whether a given key exists.
2691
+ #
2692
+ # === Iterators
2693
+ #
2694
+ # - #each_capitalized: Passes each field capitalized-name/value pair to the block.
2695
+ # - #each_capitalized_name: Passes each capitalized field name to the block.
2696
+ # - #each_header: Passes each field name/value pair to the block.
2697
+ # - #each_name: Passes each field name to the block.
2698
+ # - #each_value: Passes each string field value to the block.
2699
+ #
2700
+ # pkg:gem/net-http#lib/net/http/header.rb:181
2701
+ module Net::HTTPHeader
2702
+ # Returns the string field value for the case-insensitive field +key+,
2703
+ # or +nil+ if there is no such key;
2704
+ # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]:
2705
+ #
2706
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2707
+ # res['Connection'] # => "keep-alive"
2708
+ # res['Nosuch'] # => nil
2709
+ #
2710
+ # Note that some field values may be retrieved via convenience methods;
2711
+ # see {Getters}[rdoc-ref:Net::HTTPHeader@Getters].
2712
+ #
2713
+ # pkg:gem/net-http#lib/net/http/header.rb:226
2714
+ def [](key); end
2715
+
2716
+ # Sets the value for the case-insensitive +key+ to +val+,
2717
+ # overwriting the previous value if the field exists;
2718
+ # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]:
2719
+ #
2720
+ # req = Net::HTTP::Get.new(uri)
2721
+ # req['Accept'] # => "*/*"
2722
+ # req['Accept'] = 'text/html'
2723
+ # req['Accept'] # => "text/html"
2724
+ #
2725
+ # Note that some field values may be set via convenience methods;
2726
+ # see {Setters}[rdoc-ref:Net::HTTPHeader@Setters].
2727
+ #
2728
+ # pkg:gem/net-http#lib/net/http/header.rb:242
2729
+ def []=(key, val); end
2730
+
2731
+ # Adds value +val+ to the value array for field +key+ if the field exists;
2732
+ # creates the field with the given +key+ and +val+ if it does not exist.
2733
+ # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]:
2734
+ #
2735
+ # req = Net::HTTP::Get.new(uri)
2736
+ # req.add_field('Foo', 'bar')
2737
+ # req['Foo'] # => "bar"
2738
+ # req.add_field('Foo', 'baz')
2739
+ # req['Foo'] # => "bar, baz"
2740
+ # req.add_field('Foo', %w[baz bam])
2741
+ # req['Foo'] # => "bar, baz, baz, bam"
2742
+ # req.get_fields('Foo') # => ["bar", "baz", "baz", "bam"]
2743
+ #
2744
+ # pkg:gem/net-http#lib/net/http/header.rb:263
2745
+ def add_field(key, val); end
2746
+
2747
+ # Sets header <tt>'Authorization'</tt> using the given
2748
+ # +account+ and +password+ strings:
2749
+ #
2750
+ # req.basic_auth('my_account', 'my_password')
2751
+ # req['Authorization']
2752
+ # # => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA=="
2753
+ #
2754
+ # pkg:gem/net-http#lib/net/http/header.rb:949
2755
+ def basic_auth(account, password); end
2756
+
2757
+ # pkg:gem/net-http#lib/net/http/header.rb:495
2758
+ def canonical_each; end
2759
+
2760
+ # Returns +true+ if field <tt>'Transfer-Encoding'</tt>
2761
+ # exists and has value <tt>'chunked'</tt>,
2762
+ # +false+ otherwise;
2763
+ # see {Transfer-Encoding response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#transfer-encoding-response-header]:
2764
+ #
2765
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2766
+ # res['Transfer-Encoding'] # => "chunked"
2767
+ # res.chunked? # => true
2768
+ #
2769
+ # pkg:gem/net-http#lib/net/http/header.rb:658
2770
+ def chunked?; end
2771
+
2772
+ # Returns whether the HTTP session is to be closed.
2773
+ #
2774
+ # pkg:gem/net-http#lib/net/http/header.rb:970
2775
+ def connection_close?; end
2776
+
2777
+ # Returns whether the HTTP session is to be kept alive.
2778
+ #
2779
+ # pkg:gem/net-http#lib/net/http/header.rb:978
2780
+ def connection_keep_alive?; end
2781
+
2782
+ # Returns the value of field <tt>'Content-Length'</tt> as an integer,
2783
+ # or +nil+ if there is no such field;
2784
+ # see {Content-Length request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-length-request-header]:
2785
+ #
2786
+ # res = Net::HTTP.get_response(hostname, '/nosuch/1')
2787
+ # res.content_length # => 2
2788
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2789
+ # res.content_length # => nil
2790
+ #
2791
+ # pkg:gem/net-http#lib/net/http/header.rb:620
2792
+ def content_length; end
2793
+
2794
+ # Sets the value of field <tt>'Content-Length'</tt> to the given numeric;
2795
+ # see {Content-Length response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-length-response-header]:
2796
+ #
2797
+ # _uri = uri.dup
2798
+ # hostname = _uri.hostname # => "jsonplaceholder.typicode.com"
2799
+ # _uri.path = '/posts' # => "/posts"
2800
+ # req = Net::HTTP::Post.new(_uri) # => #<Net::HTTP::Post POST>
2801
+ # req.body = '{"title": "foo","body": "bar","userId": 1}'
2802
+ # req.content_length = req.body.size # => 42
2803
+ # req.content_type = 'application/json'
2804
+ # res = Net::HTTP.start(hostname) do |http|
2805
+ # http.request(req)
2806
+ # end # => #<Net::HTTPCreated 201 Created readbody=true>
2807
+ #
2808
+ # pkg:gem/net-http#lib/net/http/header.rb:641
2809
+ def content_length=(len); end
2810
+
2811
+ # Returns a Range object representing the value of field
2812
+ # <tt>'Content-Range'</tt>, or +nil+ if no such field exists;
2813
+ # see {Content-Range response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range-response-header]:
2814
+ #
2815
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2816
+ # res['Content-Range'] # => nil
2817
+ # res['Content-Range'] = 'bytes 0-499/1000'
2818
+ # res['Content-Range'] # => "bytes 0-499/1000"
2819
+ # res.content_range # => 0..499
2820
+ #
2821
+ # pkg:gem/net-http#lib/net/http/header.rb:674
2822
+ def content_range; end
2823
+
2824
+ # Returns the {media type}[https://en.wikipedia.org/wiki/Media_type]
2825
+ # from the value of field <tt>'Content-Type'</tt>,
2826
+ # or +nil+ if no such field exists;
2827
+ # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]:
2828
+ #
2829
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2830
+ # res['content-type'] # => "application/json; charset=utf-8"
2831
+ # res.content_type # => "application/json"
2832
+ #
2833
+ # pkg:gem/net-http#lib/net/http/header.rb:705
2834
+ def content_type; end
2835
+
2836
+ # pkg:gem/net-http#lib/net/http/header.rb:780
2837
+ def content_type=(type, params = T.unsafe(nil)); end
2838
+
2839
+ # Removes the header for the given case-insensitive +key+
2840
+ # (see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]);
2841
+ # returns the deleted value, or +nil+ if no such field exists:
2842
+ #
2843
+ # req = Net::HTTP::Get.new(uri)
2844
+ # req.delete('Accept') # => ["*/*"]
2845
+ # req.delete('Nosuch') # => nil
2846
+ #
2847
+ # pkg:gem/net-http#lib/net/http/header.rb:457
2848
+ def delete(key); end
2849
+
2850
+ # pkg:gem/net-http#lib/net/http/header.rb:375
2851
+ def each; end
2852
+
2853
+ # Like #each_header, but the keys are returned in capitalized form.
2854
+ #
2855
+ # Net::HTTPHeader#canonical_each is an alias for Net::HTTPHeader#each_capitalized.
2856
+ #
2857
+ # pkg:gem/net-http#lib/net/http/header.rb:488
2858
+ def each_capitalized; end
2859
+
2860
+ # Calls the block with each capitalized field name:
2861
+ #
2862
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2863
+ # res.each_capitalized_name do |key|
2864
+ # p key if key.start_with?('C')
2865
+ # end
2866
+ #
2867
+ # Output:
2868
+ #
2869
+ # "Content-Type"
2870
+ # "Connection"
2871
+ # "Cache-Control"
2872
+ # "Cf-Cache-Status"
2873
+ # "Cf-Ray"
2874
+ #
2875
+ # The capitalization is system-dependent;
2876
+ # see {Case Mapping}[https://docs.ruby-lang.org/en/master/case_mapping_rdoc.html].
2877
+ #
2878
+ # Returns an enumerator if no block is given.
2879
+ #
2880
+ # pkg:gem/net-http#lib/net/http/header.rb:421
2881
+ def each_capitalized_name; end
2882
+
2883
+ # Calls the block with each key/value pair:
2884
+ #
2885
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2886
+ # res.each_header do |key, value|
2887
+ # p [key, value] if key.start_with?('c')
2888
+ # end
2889
+ #
2890
+ # Output:
2891
+ #
2892
+ # ["content-type", "application/json; charset=utf-8"]
2893
+ # ["connection", "keep-alive"]
2894
+ # ["cache-control", "max-age=43200"]
2895
+ # ["cf-cache-status", "HIT"]
2896
+ # ["cf-ray", "771d17e9bc542cf5-ORD"]
2897
+ #
2898
+ # Returns an enumerator if no block is given.
2899
+ #
2900
+ # Net::HTTPHeader#each is an alias for Net::HTTPHeader#each_header.
2901
+ #
2902
+ # pkg:gem/net-http#lib/net/http/header.rb:368
2903
+ def each_header; end
2904
+
2905
+ # pkg:gem/net-http#lib/net/http/header.rb:400
2906
+ def each_key(&block); end
2907
+
2908
+ # Calls the block with each field key:
2909
+ #
2910
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2911
+ # res.each_key do |key|
2912
+ # p key if key.start_with?('c')
2913
+ # end
2914
+ #
2915
+ # Output:
2916
+ #
2917
+ # "content-type"
2918
+ # "connection"
2919
+ # "cache-control"
2920
+ # "cf-cache-status"
2921
+ # "cf-ray"
2922
+ #
2923
+ # Returns an enumerator if no block is given.
2924
+ #
2925
+ # Net::HTTPHeader#each_name is an alias for Net::HTTPHeader#each_key.
2926
+ #
2927
+ # pkg:gem/net-http#lib/net/http/header.rb:395
2928
+ def each_name(&block); end
2929
+
2930
+ # Calls the block with each string field value:
2931
+ #
2932
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2933
+ # res.each_value do |value|
2934
+ # p value if value.start_with?('c')
2935
+ # end
2936
+ #
2937
+ # Output:
2938
+ #
2939
+ # "chunked"
2940
+ # "cf-q-config;dur=6.0000002122251e-06"
2941
+ # "cloudflare"
2942
+ #
2943
+ # Returns an enumerator if no block is given.
2944
+ #
2945
+ # pkg:gem/net-http#lib/net/http/header.rb:442
2946
+ def each_value; end
2947
+
2948
+ # call-seq:
2949
+ # fetch(key, default_val = nil) {|key| ... } -> object
2950
+ # fetch(key, default_val = nil) -> value or default_val
2951
+ #
2952
+ # With a block, returns the string value for +key+ if it exists;
2953
+ # otherwise returns the value of the block;
2954
+ # ignores the +default_val+;
2955
+ # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]:
2956
+ #
2957
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2958
+ #
2959
+ # # Field exists; block not called.
2960
+ # res.fetch('Connection') do |value|
2961
+ # fail 'Cannot happen'
2962
+ # end # => "keep-alive"
2963
+ #
2964
+ # # Field does not exist; block called.
2965
+ # res.fetch('Nosuch') do |value|
2966
+ # value.downcase
2967
+ # end # => "nosuch"
2968
+ #
2969
+ # With no block, returns the string value for +key+ if it exists;
2970
+ # otherwise, returns +default_val+ if it was given;
2971
+ # otherwise raises an exception:
2972
+ #
2973
+ # res.fetch('Connection', 'Foo') # => "keep-alive"
2974
+ # res.fetch('Nosuch', 'Foo') # => "Foo"
2975
+ # res.fetch('Nosuch') # Raises KeyError.
2976
+ #
2977
+ # pkg:gem/net-http#lib/net/http/header.rb:345
2978
+ def fetch(key, *args, &block); end
2979
+
2980
+ # pkg:gem/net-http#lib/net/http/header.rb:823
2981
+ def form_data=(params, sep = T.unsafe(nil)); end
2982
+
2983
+ # Returns the array field value for the given +key+,
2984
+ # or +nil+ if there is no such field;
2985
+ # see {Fields}[rdoc-ref:Net::HTTPHeader@Fields]:
2986
+ #
2987
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
2988
+ # res.get_fields('Connection') # => ["keep-alive"]
2989
+ # res.get_fields('Nosuch') # => nil
2990
+ #
2991
+ # pkg:gem/net-http#lib/net/http/header.rb:310
2992
+ def get_fields(key); end
2993
+
2994
+ # pkg:gem/net-http#lib/net/http/header.rb:187
2995
+ def initialize_http_header(initheader); end
2996
+
2997
+ # Returns +true+ if the field for the case-insensitive +key+ exists, +false+ otherwise:
2998
+ #
2999
+ # req = Net::HTTP::Get.new(uri)
3000
+ # req.key?('Accept') # => true
3001
+ # req.key?('Nosuch') # => false
3002
+ #
3003
+ # pkg:gem/net-http#lib/net/http/header.rb:467
3004
+ def key?(key); end
3005
+
3006
+ # pkg:gem/net-http#lib/net/http/header.rb:214
3007
+ def length; end
3008
+
3009
+ # Returns the leading ('type') part of the
3010
+ # {media type}[https://en.wikipedia.org/wiki/Media_type]
3011
+ # from the value of field <tt>'Content-Type'</tt>,
3012
+ # or +nil+ if no such field exists;
3013
+ # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]:
3014
+ #
3015
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
3016
+ # res['content-type'] # => "application/json; charset=utf-8"
3017
+ # res.main_type # => "application"
3018
+ #
3019
+ # pkg:gem/net-http#lib/net/http/header.rb:727
3020
+ def main_type; end
3021
+
3022
+ # Sets header <tt>'Proxy-Authorization'</tt> using the given
3023
+ # +account+ and +password+ strings:
3024
+ #
3025
+ # req.proxy_basic_auth('my_account', 'my_password')
3026
+ # req['Proxy-Authorization']
3027
+ # # => "Basic bXlfYWNjb3VudDpteV9wYXNzd29yZA=="
3028
+ #
3029
+ # pkg:gem/net-http#lib/net/http/header.rb:960
3030
+ def proxy_basic_auth(account, password); end
3031
+
3032
+ # Returns an array of Range objects that represent
3033
+ # the value of field <tt>'Range'</tt>,
3034
+ # or +nil+ if there is no such field;
3035
+ # see {Range request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header]:
3036
+ #
3037
+ # req = Net::HTTP::Get.new(uri)
3038
+ # req['Range'] = 'bytes=0-99,200-299,400-499'
3039
+ # req.range # => [0..99, 200..299, 400..499]
3040
+ # req.delete('Range')
3041
+ # req.range # # => nil
3042
+ #
3043
+ # pkg:gem/net-http#lib/net/http/header.rb:513
3044
+ def range; end
3045
+
3046
+ # pkg:gem/net-http#lib/net/http/header.rb:609
3047
+ def range=(r, e = T.unsafe(nil)); end
3048
+
3049
+ # Returns the integer representing length of the value of field
3050
+ # <tt>'Content-Range'</tt>, or +nil+ if no such field exists;
3051
+ # see {Content-Range response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-range-response-header]:
3052
+ #
3053
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
3054
+ # res['Content-Range'] # => nil
3055
+ # res['Content-Range'] = 'bytes 0-499/1000'
3056
+ # res.range_length # => 500
3057
+ #
3058
+ # pkg:gem/net-http#lib/net/http/header.rb:691
3059
+ def range_length; end
3060
+
3061
+ # Sets the value of field <tt>'Content-Type'</tt>;
3062
+ # returns the new value;
3063
+ # see {Content-Type request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-request-header]:
3064
+ #
3065
+ # req = Net::HTTP::Get.new(uri)
3066
+ # req.set_content_type('application/json') # => ["application/json"]
3067
+ #
3068
+ # Net::HTTPHeader#content_type= is an alias for Net::HTTPHeader#set_content_type.
3069
+ #
3070
+ # pkg:gem/net-http#lib/net/http/header.rb:776
3071
+ def set_content_type(type, params = T.unsafe(nil)); end
3072
+
3073
+ # Stores form data to be used in a +POST+ or +PUT+ request.
3074
+ #
3075
+ # The form data given in +params+ consists of zero or more fields;
3076
+ # each field is:
3077
+ #
3078
+ # - A scalar value.
3079
+ # - A name/value pair.
3080
+ # - An IO stream opened for reading.
3081
+ #
3082
+ # Argument +params+ should be an
3083
+ # {Enumerable}[https://docs.ruby-lang.org/en/master/Enumerable.html#module-Enumerable-label-Enumerable+in+Ruby+Classes]
3084
+ # (method <tt>params.map</tt> will be called),
3085
+ # and is often an array or hash.
3086
+ #
3087
+ # First, we set up a request:
3088
+ #
3089
+ # _uri = uri.dup
3090
+ # _uri.path ='/posts'
3091
+ # req = Net::HTTP::Post.new(_uri)
3092
+ #
3093
+ # <b>Argument +params+ As an Array</b>
3094
+ #
3095
+ # When +params+ is an array,
3096
+ # each of its elements is a subarray that defines a field;
3097
+ # the subarray may contain:
3098
+ #
3099
+ # - One string:
3100
+ #
3101
+ # req.set_form([['foo'], ['bar'], ['baz']])
3102
+ #
3103
+ # - Two strings:
3104
+ #
3105
+ # req.set_form([%w[foo 0], %w[bar 1], %w[baz 2]])
3106
+ #
3107
+ # - When argument +enctype+ (see below) is given as
3108
+ # <tt>'multipart/form-data'</tt>:
3109
+ #
3110
+ # - A string name and an IO stream opened for reading:
3111
+ #
3112
+ # require 'stringio'
3113
+ # req.set_form([['file', StringIO.new('Ruby is cool.')]])
3114
+ #
3115
+ # - A string name, an IO stream opened for reading,
3116
+ # and an options hash, which may contain these entries:
3117
+ #
3118
+ # - +:filename+: The name of the file to use.
3119
+ # - +:content_type+: The content type of the uploaded file.
3120
+ #
3121
+ # Example:
3122
+ #
3123
+ # req.set_form([['file', file, {filename: "other-filename.foo"}]]
3124
+ #
3125
+ # The various forms may be mixed:
3126
+ #
3127
+ # req.set_form(['foo', %w[bar 1], ['file', file]])
3128
+ #
3129
+ # <b>Argument +params+ As a Hash</b>
3130
+ #
3131
+ # When +params+ is a hash,
3132
+ # each of its entries is a name/value pair that defines a field:
3133
+ #
3134
+ # - The name is a string.
3135
+ # - The value may be:
3136
+ #
3137
+ # - +nil+.
3138
+ # - Another string.
3139
+ # - An IO stream opened for reading
3140
+ # (only when argument +enctype+ -- see below -- is given as
3141
+ # <tt>'multipart/form-data'</tt>).
3142
+ #
3143
+ # Examples:
3144
+ #
3145
+ # # Nil-valued fields.
3146
+ # req.set_form({'foo' => nil, 'bar' => nil, 'baz' => nil})
3147
+ #
3148
+ # # String-valued fields.
3149
+ # req.set_form({'foo' => 0, 'bar' => 1, 'baz' => 2})
3150
+ #
3151
+ # # IO-valued field.
3152
+ # require 'stringio'
3153
+ # req.set_form({'file' => StringIO.new('Ruby is cool.')})
3154
+ #
3155
+ # # Mixture of fields.
3156
+ # req.set_form({'foo' => nil, 'bar' => 1, 'file' => file})
3157
+ #
3158
+ # Optional argument +enctype+ specifies the value to be given
3159
+ # to field <tt>'Content-Type'</tt>, and must be one of:
3160
+ #
3161
+ # - <tt>'application/x-www-form-urlencoded'</tt> (the default).
3162
+ # - <tt>'multipart/form-data'</tt>;
3163
+ # see {RFC 7578}[https://www.rfc-editor.org/rfc/rfc7578].
3164
+ #
3165
+ # Optional argument +formopt+ is a hash of options
3166
+ # (applicable only when argument +enctype+
3167
+ # is <tt>'multipart/form-data'</tt>)
3168
+ # that may include the following entries:
3169
+ #
3170
+ # - +:boundary+: The value is the boundary string for the multipart message.
3171
+ # If not given, the boundary is a random string.
3172
+ # See {Boundary}[https://www.rfc-editor.org/rfc/rfc7578#section-4.1].
3173
+ # - +:charset+: Value is the character set for the form submission.
3174
+ # Field names and values of non-file fields should be encoded with this charset.
3175
+ #
3176
+ # pkg:gem/net-http#lib/net/http/header.rb:928
3177
+ def set_form(params, enctype = T.unsafe(nil), formopt = T.unsafe(nil)); end
3178
+
3179
+ # Sets the request body to a URL-encoded string derived from argument +params+,
3180
+ # and sets request header field <tt>'Content-Type'</tt>
3181
+ # to <tt>'application/x-www-form-urlencoded'</tt>.
3182
+ #
3183
+ # The resulting request is suitable for HTTP request +POST+ or +PUT+.
3184
+ #
3185
+ # Argument +params+ must be suitable for use as argument +enum+ to
3186
+ # {URI.encode_www_form}[https://docs.ruby-lang.org/en/master/URI.html#method-c-encode_www_form].
3187
+ #
3188
+ # With only argument +params+ given,
3189
+ # sets the body to a URL-encoded string with the default separator <tt>'&'</tt>:
3190
+ #
3191
+ # req = Net::HTTP::Post.new('example.com')
3192
+ #
3193
+ # req.set_form_data(q: 'ruby', lang: 'en')
3194
+ # req.body # => "q=ruby&lang=en"
3195
+ # req['Content-Type'] # => "application/x-www-form-urlencoded"
3196
+ #
3197
+ # req.set_form_data([['q', 'ruby'], ['lang', 'en']])
3198
+ # req.body # => "q=ruby&lang=en"
3199
+ #
3200
+ # req.set_form_data(q: ['ruby', 'perl'], lang: 'en')
3201
+ # req.body # => "q=ruby&q=perl&lang=en"
3202
+ #
3203
+ # req.set_form_data([['q', 'ruby'], ['q', 'perl'], ['lang', 'en']])
3204
+ # req.body # => "q=ruby&q=perl&lang=en"
3205
+ #
3206
+ # With string argument +sep+ also given,
3207
+ # uses that string as the separator:
3208
+ #
3209
+ # req.set_form_data({q: 'ruby', lang: 'en'}, '|')
3210
+ # req.body # => "q=ruby|lang=en"
3211
+ #
3212
+ # Net::HTTPHeader#form_data= is an alias for Net::HTTPHeader#set_form_data.
3213
+ #
3214
+ # pkg:gem/net-http#lib/net/http/header.rb:816
3215
+ def set_form_data(params, sep = T.unsafe(nil)); end
3216
+
3217
+ # call-seq:
3218
+ # set_range(length) -> length
3219
+ # set_range(offset, length) -> range
3220
+ # set_range(begin..length) -> range
3221
+ #
3222
+ # Sets the value for field <tt>'Range'</tt>;
3223
+ # see {Range request header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#range-request-header]:
3224
+ #
3225
+ # With argument +length+:
3226
+ #
3227
+ # req = Net::HTTP::Get.new(uri)
3228
+ # req.set_range(100) # => 100
3229
+ # req['Range'] # => "bytes=0-99"
3230
+ #
3231
+ # With arguments +offset+ and +length+:
3232
+ #
3233
+ # req.set_range(100, 100) # => 100...200
3234
+ # req['Range'] # => "bytes=100-199"
3235
+ #
3236
+ # With argument +range+:
3237
+ #
3238
+ # req.set_range(100..199) # => 100..199
3239
+ # req['Range'] # => "bytes=100-199"
3240
+ #
3241
+ # Net::HTTPHeader#range= is an alias for Net::HTTPHeader#set_range.
3242
+ #
3243
+ # pkg:gem/net-http#lib/net/http/header.rb:580
3244
+ def set_range(r, e = T.unsafe(nil)); end
3245
+
3246
+ # pkg:gem/net-http#lib/net/http/header.rb:210
3247
+ def size; end
3248
+
3249
+ # Returns the trailing ('subtype') part of the
3250
+ # {media type}[https://en.wikipedia.org/wiki/Media_type]
3251
+ # from the value of field <tt>'Content-Type'</tt>,
3252
+ # or +nil+ if no such field exists;
3253
+ # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]:
3254
+ #
3255
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
3256
+ # res['content-type'] # => "application/json; charset=utf-8"
3257
+ # res.sub_type # => "json"
3258
+ #
3259
+ # pkg:gem/net-http#lib/net/http/header.rb:742
3260
+ def sub_type; end
3261
+
3262
+ # Returns a hash of the key/value pairs:
3263
+ #
3264
+ # req = Net::HTTP::Get.new(uri)
3265
+ # req.to_hash
3266
+ # # =>
3267
+ # {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
3268
+ # "accept"=>["*/*"],
3269
+ # "user-agent"=>["Ruby"],
3270
+ # "host"=>["jsonplaceholder.typicode.com"]}
3271
+ #
3272
+ # pkg:gem/net-http#lib/net/http/header.rb:481
3273
+ def to_hash; end
3274
+
3275
+ # Returns the trailing ('parameters') part of the value of field <tt>'Content-Type'</tt>,
3276
+ # or +nil+ if no such field exists;
3277
+ # see {Content-Type response header}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#content-type-response-header]:
3278
+ #
3279
+ # res = Net::HTTP.get_response(hostname, '/todos/1')
3280
+ # res['content-type'] # => "application/json; charset=utf-8"
3281
+ # res.type_params # => {"charset"=>"utf-8"}
3282
+ #
3283
+ # pkg:gem/net-http#lib/net/http/header.rb:757
3284
+ def type_params; end
3285
+
3286
+ private
3287
+
3288
+ # pkg:gem/net-http#lib/net/http/header.rb:288
3289
+ def append_field_value(ary, val); end
3290
+
3291
+ # pkg:gem/net-http#lib/net/http/header.rb:964
3292
+ def basic_encode(account, password); end
3293
+
3294
+ # pkg:gem/net-http#lib/net/http/header.rb:497
3295
+ def capitalize(name); end
3296
+
3297
+ # :stopdoc:
3298
+ #
3299
+ # pkg:gem/net-http#lib/net/http/header.rb:273
3300
+ def set_field(key, val); end
3301
+ end
3302
+
3303
+ # The maximum length of HTTP header values.
3304
+ #
3305
+ # pkg:gem/net-http#lib/net/http/header.rb:185
3306
+ Net::HTTPHeader::MAX_FIELD_LENGTH = T.let(T.unsafe(nil), Integer)
3307
+
3308
+ # The maximum length of HTTP header keys.
3309
+ #
3310
+ # pkg:gem/net-http#lib/net/http/header.rb:183
3311
+ Net::HTTPHeader::MAX_KEY_LENGTH = T.let(T.unsafe(nil), Integer)
3312
+
3313
+ # pkg:gem/net-http#lib/net/http/responses.rb:26
3314
+ Net::HTTPInformation::EXCEPTION_TYPE = Net::HTTPError
3315
+
3316
+ # Response class for <tt>Loop Detected (WebDAV)</tt> responses (status code 508).
3317
+ #
3318
+ # The server detected an infinite loop while processing the request.
3319
+ #
3320
+ # :include: doc/net-http/included_getters.rdoc
3321
+ #
3322
+ # References:
3323
+ #
3324
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508].
3325
+ # - {RFC 5942}[https://www.rfc-editor.org/rfc/rfc5842.html#section-7.2].
3326
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#508].
3327
+ #
3328
+ # pkg:gem/net-http#lib/net/http/responses.rb:1125
3329
+ class Net::HTTPLoopDetected < ::Net::HTTPServerError; end
3330
+
3331
+ # :stopdoc:
3332
+ #
3333
+ # pkg:gem/net-http#lib/net/http/responses.rb:1127
3334
+ Net::HTTPLoopDetected::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
3335
+
3336
+ # Response class for <tt>Misdirected Request</tt> responses (status code 421).
3337
+ #
3338
+ # The request was directed at a server that is not able to produce a response.
3339
+ #
3340
+ # :include: doc/net-http/included_getters.rdoc
3341
+ #
3342
+ # References:
3343
+ #
3344
+ # - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-421-misdirected-request].
3345
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#421].
3346
+ #
3347
+ # pkg:gem/net-http#lib/net/http/responses.rb:823
3348
+ class Net::HTTPMisdirectedRequest < ::Net::HTTPClientError; end
3349
+
3350
+ # :stopdoc:
3351
+ #
3352
+ # pkg:gem/net-http#lib/net/http/responses.rb:825
3353
+ Net::HTTPMisdirectedRequest::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
3354
+
3355
+ # pkg:gem/net-http#lib/net/http/responses.rb:402
3356
+ Net::HTTPMovedTemporarily = Net::HTTPFound
3357
+
3358
+ # pkg:gem/net-http#lib/net/http/responses.rb:365
3359
+ Net::HTTPMultipleChoice = Net::HTTPMultipleChoices
3360
+
3361
+ # Response class for <tt>Not Extended</tt> responses (status code 510).
3362
+ #
3363
+ # Further extensions to the request are required for the server to fulfill it.
3364
+ #
3365
+ # :include: doc/net-http/included_getters.rdoc
3366
+ #
3367
+ # References:
3368
+ #
3369
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510].
3370
+ # - {RFC 2774}[https://www.rfc-editor.org/rfc/rfc2774.html#section-7].
3371
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#510].
3372
+ #
3373
+ # pkg:gem/net-http#lib/net/http/responses.rb:1143
3374
+ class Net::HTTPNotExtended < ::Net::HTTPServerError; end
3375
+
3376
+ # :stopdoc:
3377
+ #
3378
+ # pkg:gem/net-http#lib/net/http/responses.rb:1145
3379
+ Net::HTTPNotExtended::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
3380
+
3381
+ # Response class for <tt>Payload Too Large</tt> responses (status code 413).
3382
+ #
3383
+ # The request is larger than the server is willing or able to process.
3384
+ #
3385
+ # :include: doc/net-http/included_getters.rdoc
3386
+ #
3387
+ # References:
3388
+ #
3389
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413].
3390
+ # - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-413-content-too-large].
3391
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#413].
3392
+ #
3393
+ # pkg:gem/net-http#lib/net/http/responses.rb:730
3394
+ class Net::HTTPPayloadTooLarge < ::Net::HTTPClientError; end
3395
+
3396
+ # :stopdoc:
3397
+ #
3398
+ # pkg:gem/net-http#lib/net/http/responses.rb:732
3399
+ Net::HTTPPayloadTooLarge::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
3400
+
3401
+ # Response class for +Processing+ responses (status code 102).
3402
+ #
3403
+ # The +Processing+ response indicates that the server has received
3404
+ # and is processing the request, but no response is available yet.
3405
+ #
3406
+ # :include: doc/net-http/included_getters.rdoc
3407
+ #
3408
+ # References:
3409
+ #
3410
+ # - {RFC 2518}[https://www.rfc-editor.org/rfc/rfc2518#section-10.1].
3411
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#102].
3412
+ #
3413
+ # pkg:gem/net-http#lib/net/http/responses.rb:138
3414
+ class Net::HTTPProcessing < ::Net::HTTPInformation; end
3415
+
3416
+ # :stopdoc:
3417
+ #
3418
+ # pkg:gem/net-http#lib/net/http/responses.rb:140
3419
+ Net::HTTPProcessing::HAS_BODY = T.let(T.unsafe(nil), FalseClass)
3420
+
3421
+ # Response class for <tt>Range Not Satisfiable</tt> responses (status code 416).
3422
+ #
3423
+ # The request entity has a media type which the server or resource does not support.
3424
+ #
3425
+ # :include: doc/net-http/included_getters.rdoc
3426
+ #
3427
+ # References:
3428
+ #
3429
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416].
3430
+ # - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-416-range-not-satisfiable].
3431
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#416].
3432
+ #
3433
+ # pkg:gem/net-http#lib/net/http/responses.rb:784
3434
+ class Net::HTTPRangeNotSatisfiable < ::Net::HTTPClientError; end
3435
+
3436
+ # :stopdoc:
3437
+ #
3438
+ # pkg:gem/net-http#lib/net/http/responses.rb:786
3439
+ Net::HTTPRangeNotSatisfiable::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
3440
+
3441
+ # pkg:gem/net-http#lib/net/http/responses.rb:58
3442
+ Net::HTTPRedirection::EXCEPTION_TYPE = Net::HTTPRetriableError
3443
+
3444
+ # This class is the base class for \Net::HTTP request classes.
3445
+ # The class should not be used directly;
3446
+ # instead you should use its subclasses, listed below.
3447
+ #
3448
+ # == Creating a Request
3449
+ #
3450
+ # An request object may be created with either a URI or a string hostname:
3451
+ #
3452
+ # require 'net/http'
3453
+ # uri = URI('https://jsonplaceholder.typicode.com/')
3454
+ # req = Net::HTTP::Get.new(uri) # => #<Net::HTTP::Get GET>
3455
+ # req = Net::HTTP::Get.new(uri.hostname) # => #<Net::HTTP::Get GET>
3456
+ #
3457
+ # And with any of the subclasses:
3458
+ #
3459
+ # req = Net::HTTP::Head.new(uri) # => #<Net::HTTP::Head HEAD>
3460
+ # req = Net::HTTP::Post.new(uri) # => #<Net::HTTP::Post POST>
3461
+ # req = Net::HTTP::Put.new(uri) # => #<Net::HTTP::Put PUT>
3462
+ # # ...
3463
+ #
3464
+ # The new instance is suitable for use as the argument to Net::HTTP#request.
3465
+ #
3466
+ # == Request Headers
3467
+ #
3468
+ # A new request object has these header fields by default:
3469
+ #
3470
+ # req.to_hash
3471
+ # # =>
3472
+ # {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
3473
+ # "accept"=>["*/*"],
3474
+ # "user-agent"=>["Ruby"],
3475
+ # "host"=>["jsonplaceholder.typicode.com"]}
3476
+ #
3477
+ # See:
3478
+ #
3479
+ # - {Request header Accept-Encoding}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Accept-Encoding]
3480
+ # and {Compression and Decompression}[rdoc-ref:Net::HTTP@Compression+and+Decompression].
3481
+ # - {Request header Accept}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#accept-request-header].
3482
+ # - {Request header User-Agent}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#user-agent-request-header].
3483
+ # - {Request header Host}[https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#host-request-header].
3484
+ #
3485
+ # You can add headers or override default headers:
3486
+ #
3487
+ # # res = Net::HTTP::Get.new(uri, {'foo' => '0', 'bar' => '1'})
3488
+ #
3489
+ # This class (and therefore its subclasses) also includes (indirectly)
3490
+ # module Net::HTTPHeader, which gives access to its
3491
+ # {methods for setting headers}[rdoc-ref:Net::HTTPHeader@Setters].
3492
+ #
3493
+ # == Request Subclasses
3494
+ #
3495
+ # Subclasses for HTTP requests:
3496
+ #
3497
+ # - Net::HTTP::Get
3498
+ # - Net::HTTP::Head
3499
+ # - Net::HTTP::Post
3500
+ # - Net::HTTP::Put
3501
+ # - Net::HTTP::Delete
3502
+ # - Net::HTTP::Options
3503
+ # - Net::HTTP::Trace
3504
+ # - Net::HTTP::Patch
3505
+ #
3506
+ # Subclasses for WebDAV requests:
3507
+ #
3508
+ # - Net::HTTP::Propfind
3509
+ # - Net::HTTP::Proppatch
3510
+ # - Net::HTTP::Mkcol
3511
+ # - Net::HTTP::Copy
3512
+ # - Net::HTTP::Move
3513
+ # - Net::HTTP::Lock
3514
+ # - Net::HTTP::Unlock
3515
+ #
3516
+ # pkg:gem/net-http#lib/net/http/request.rb:75
3517
+ class Net::HTTPRequest < ::Net::HTTPGenericRequest
3518
+ # Creates an HTTP request object for +path+.
3519
+ #
3520
+ # +initheader+ are the default headers to use. Net::HTTP adds
3521
+ # Accept-Encoding to enable compression of the response body unless
3522
+ # Accept-Encoding or Range are supplied in +initheader+.
3523
+ #
3524
+ # pkg:gem/net-http#lib/net/http/request.rb:82
3525
+ def initialize(path, initheader = T.unsafe(nil)); end
3526
+ end
3527
+
3528
+ # pkg:gem/net-http#lib/net/http/responses.rb:753
3529
+ Net::HTTPRequestURITooLarge = Net::HTTPURITooLong
3530
+
3531
+ # This class is the base class for \Net::HTTP response classes.
3532
+ #
3533
+ # == About the Examples
3534
+ #
3535
+ # :include: doc/net-http/examples.rdoc
3536
+ #
3537
+ # == Returned Responses
3538
+ #
3539
+ # \Method Net::HTTP.get_response returns
3540
+ # an instance of one of the subclasses of \Net::HTTPResponse:
3541
+ #
3542
+ # Net::HTTP.get_response(uri)
3543
+ # # => #<Net::HTTPOK 200 OK readbody=true>
3544
+ # Net::HTTP.get_response(hostname, '/nosuch')
3545
+ # # => #<Net::HTTPNotFound 404 Not Found readbody=true>
3546
+ #
3547
+ # As does method Net::HTTP#request:
3548
+ #
3549
+ # req = Net::HTTP::Get.new(uri)
3550
+ # Net::HTTP.start(hostname) do |http|
3551
+ # http.request(req)
3552
+ # end # => #<Net::HTTPOK 200 OK readbody=true>
3553
+ #
3554
+ # \Class \Net::HTTPResponse includes module Net::HTTPHeader,
3555
+ # which provides access to response header values via (among others):
3556
+ #
3557
+ # - \Hash-like method <tt>[]</tt>.
3558
+ # - Specific reader methods, such as +content_type+.
3559
+ #
3560
+ # Examples:
3561
+ #
3562
+ # res = Net::HTTP.get_response(uri) # => #<Net::HTTPOK 200 OK readbody=true>
3563
+ # res['Content-Type'] # => "text/html; charset=UTF-8"
3564
+ # res.content_type # => "text/html"
3565
+ #
3566
+ # == Response Subclasses
3567
+ #
3568
+ # \Class \Net::HTTPResponse has a subclass for each
3569
+ # {HTTP status code}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes].
3570
+ # You can look up the response class for a given code:
3571
+ #
3572
+ # Net::HTTPResponse::CODE_TO_OBJ['200'] # => Net::HTTPOK
3573
+ # Net::HTTPResponse::CODE_TO_OBJ['400'] # => Net::HTTPBadRequest
3574
+ # Net::HTTPResponse::CODE_TO_OBJ['404'] # => Net::HTTPNotFound
3575
+ #
3576
+ # And you can retrieve the status code for a response object:
3577
+ #
3578
+ # Net::HTTP.get_response(uri).code # => "200"
3579
+ # Net::HTTP.get_response(hostname, '/nosuch').code # => "404"
3580
+ #
3581
+ # The response subclasses (indentation shows class hierarchy):
3582
+ #
3583
+ # - Net::HTTPUnknownResponse (for unhandled \HTTP extensions).
3584
+ #
3585
+ # - Net::HTTPInformation:
3586
+ #
3587
+ # - Net::HTTPContinue (100)
3588
+ # - Net::HTTPSwitchProtocol (101)
3589
+ # - Net::HTTPProcessing (102)
3590
+ # - Net::HTTPEarlyHints (103)
3591
+ #
3592
+ # - Net::HTTPSuccess:
3593
+ #
3594
+ # - Net::HTTPOK (200)
3595
+ # - Net::HTTPCreated (201)
3596
+ # - Net::HTTPAccepted (202)
3597
+ # - Net::HTTPNonAuthoritativeInformation (203)
3598
+ # - Net::HTTPNoContent (204)
3599
+ # - Net::HTTPResetContent (205)
3600
+ # - Net::HTTPPartialContent (206)
3601
+ # - Net::HTTPMultiStatus (207)
3602
+ # - Net::HTTPAlreadyReported (208)
3603
+ # - Net::HTTPIMUsed (226)
3604
+ #
3605
+ # - Net::HTTPRedirection:
3606
+ #
3607
+ # - Net::HTTPMultipleChoices (300)
3608
+ # - Net::HTTPMovedPermanently (301)
3609
+ # - Net::HTTPFound (302)
3610
+ # - Net::HTTPSeeOther (303)
3611
+ # - Net::HTTPNotModified (304)
3612
+ # - Net::HTTPUseProxy (305)
3613
+ # - Net::HTTPTemporaryRedirect (307)
3614
+ # - Net::HTTPPermanentRedirect (308)
3615
+ #
3616
+ # - Net::HTTPClientError:
3617
+ #
3618
+ # - Net::HTTPBadRequest (400)
3619
+ # - Net::HTTPUnauthorized (401)
3620
+ # - Net::HTTPPaymentRequired (402)
3621
+ # - Net::HTTPForbidden (403)
3622
+ # - Net::HTTPNotFound (404)
3623
+ # - Net::HTTPMethodNotAllowed (405)
3624
+ # - Net::HTTPNotAcceptable (406)
3625
+ # - Net::HTTPProxyAuthenticationRequired (407)
3626
+ # - Net::HTTPRequestTimeOut (408)
3627
+ # - Net::HTTPConflict (409)
3628
+ # - Net::HTTPGone (410)
3629
+ # - Net::HTTPLengthRequired (411)
3630
+ # - Net::HTTPPreconditionFailed (412)
3631
+ # - Net::HTTPRequestEntityTooLarge (413)
3632
+ # - Net::HTTPRequestURITooLong (414)
3633
+ # - Net::HTTPUnsupportedMediaType (415)
3634
+ # - Net::HTTPRequestedRangeNotSatisfiable (416)
3635
+ # - Net::HTTPExpectationFailed (417)
3636
+ # - Net::HTTPMisdirectedRequest (421)
3637
+ # - Net::HTTPUnprocessableEntity (422)
3638
+ # - Net::HTTPLocked (423)
3639
+ # - Net::HTTPFailedDependency (424)
3640
+ # - Net::HTTPUpgradeRequired (426)
3641
+ # - Net::HTTPPreconditionRequired (428)
3642
+ # - Net::HTTPTooManyRequests (429)
3643
+ # - Net::HTTPRequestHeaderFieldsTooLarge (431)
3644
+ # - Net::HTTPUnavailableForLegalReasons (451)
3645
+ #
3646
+ # - Net::HTTPServerError:
3647
+ #
3648
+ # - Net::HTTPInternalServerError (500)
3649
+ # - Net::HTTPNotImplemented (501)
3650
+ # - Net::HTTPBadGateway (502)
3651
+ # - Net::HTTPServiceUnavailable (503)
3652
+ # - Net::HTTPGatewayTimeOut (504)
3653
+ # - Net::HTTPVersionNotSupported (505)
3654
+ # - Net::HTTPVariantAlsoNegotiates (506)
3655
+ # - Net::HTTPInsufficientStorage (507)
3656
+ # - Net::HTTPLoopDetected (508)
3657
+ # - Net::HTTPNotExtended (510)
3658
+ # - Net::HTTPNetworkAuthenticationRequired (511)
3659
+ #
3660
+ # There is also the Net::HTTPBadResponse exception which is raised when
3661
+ # there is a protocol error.
3662
+ #
3663
+ # pkg:gem/net-http#lib/net/http/response.rb:135
3664
+ class Net::HTTPResponse
3665
+ include ::Net::HTTPHeader
3666
+
3667
+ # pkg:gem/net-http#lib/net/http/response.rb:195
3668
+ def initialize(httpv, code, msg); end
3669
+
3670
+ # Returns the string response body;
3671
+ # note that repeated calls for the unmodified body return a cached string:
3672
+ #
3673
+ # path = '/todos/1'
3674
+ # Net::HTTP.start(hostname) do |http|
3675
+ # res = http.get(path)
3676
+ # p res.body
3677
+ # p http.head(path).body # No body.
3678
+ # end
3679
+ #
3680
+ # Output:
3681
+ #
3682
+ # "{\n \"userId\": 1,\n \"id\": 1,\n \"title\": \"delectus aut autem\",\n \"completed\": false\n}"
3683
+ # nil
3684
+ #
3685
+ # pkg:gem/net-http#lib/net/http/response.rb:401
3686
+ def body; end
3687
+
3688
+ # Sets the body of the response to the given value.
3689
+ #
3690
+ # pkg:gem/net-http#lib/net/http/response.rb:406
3691
+ def body=(value); end
3692
+
3693
+ # Returns the value set by body_encoding=, or +false+ if none;
3694
+ # see #body_encoding=.
3695
+ #
3696
+ # pkg:gem/net-http#lib/net/http/response.rb:230
3697
+ def body_encoding; end
3698
+
3699
+ # Sets the encoding that should be used when reading the body:
3700
+ #
3701
+ # - If the given value is an Encoding object, that encoding will be used.
3702
+ # - Otherwise if the value is a string, the value of
3703
+ # {Encoding#find(value)}[https://docs.ruby-lang.org/en/master/Encoding.html#method-c-find]
3704
+ # will be used.
3705
+ # - Otherwise an encoding will be deduced from the body itself.
3706
+ #
3707
+ # Examples:
3708
+ #
3709
+ # http = Net::HTTP.new(hostname)
3710
+ # req = Net::HTTP::Get.new('/')
3711
+ #
3712
+ # http.request(req) do |res|
3713
+ # p res.body.encoding # => #<Encoding:ASCII-8BIT>
3714
+ # end
3715
+ #
3716
+ # http.request(req) do |res|
3717
+ # res.body_encoding = "UTF-8"
3718
+ # p res.body.encoding # => #<Encoding:UTF-8>
3719
+ # end
3720
+ #
3721
+ # pkg:gem/net-http#lib/net/http/response.rb:254
3722
+ def body_encoding=(value); end
3723
+
3724
+ # The HTTP result code string. For example, '302'. You can also
3725
+ # determine the response type by examining which response subclass
3726
+ # the response object is an instance of.
3727
+ #
3728
+ # pkg:gem/net-http#lib/net/http/response.rb:214
3729
+ def code; end
3730
+
3731
+ # response <-> exception relationship
3732
+ #
3733
+ # pkg:gem/net-http#lib/net/http/response.rb:271
3734
+ def code_type; end
3735
+
3736
+ # Set to true automatically when the request did not contain an
3737
+ # Accept-Encoding header from the user.
3738
+ #
3739
+ # pkg:gem/net-http#lib/net/http/response.rb:226
3740
+ def decode_content; end
3741
+
3742
+ # Set to true automatically when the request did not contain an
3743
+ # Accept-Encoding header from the user.
3744
+ #
3745
+ # pkg:gem/net-http#lib/net/http/response.rb:226
3746
+ def decode_content=(_arg0); end
3747
+
3748
+ # pkg:gem/net-http#lib/net/http/response.rb:410
3749
+ def entity; end
3750
+
3751
+ # pkg:gem/net-http#lib/net/http/response.rb:275
3752
+ def error!; end
3753
+
3754
+ # pkg:gem/net-http#lib/net/http/response.rb:281
3755
+ def error_type; end
3756
+
3757
+ # pkg:gem/net-http#lib/net/http/response.rb:303
3758
+ def header; end
3759
+
3760
+ # The HTTP version supported by the server.
3761
+ #
3762
+ # pkg:gem/net-http#lib/net/http/response.rb:209
3763
+ def http_version; end
3764
+
3765
+ # Whether to ignore EOF when reading bodies with a specified Content-Length
3766
+ # header.
3767
+ #
3768
+ # pkg:gem/net-http#lib/net/http/response.rb:261
3769
+ def ignore_eof; end
3770
+
3771
+ # Whether to ignore EOF when reading bodies with a specified Content-Length
3772
+ # header.
3773
+ #
3774
+ # pkg:gem/net-http#lib/net/http/response.rb:261
3775
+ def ignore_eof=(_arg0); end
3776
+
3777
+ # pkg:gem/net-http#lib/net/http/response.rb:263
3778
+ def inspect; end
3779
+
3780
+ # The HTTP result message sent by the server. For example, 'Not Found'.
3781
+ #
3782
+ # pkg:gem/net-http#lib/net/http/response.rb:217
3783
+ def message; end
3784
+
3785
+ # pkg:gem/net-http#lib/net/http/response.rb:218
3786
+ def msg; end
3787
+
3788
+ # Gets the entity body returned by the remote HTTP server.
3789
+ #
3790
+ # If a block is given, the body is passed to the block, and
3791
+ # the body is provided in fragments, as it is read in from the socket.
3792
+ #
3793
+ # If +dest+ argument is given, response is read into that variable,
3794
+ # with <code>dest#<<</code> method (it could be String or IO, or any
3795
+ # other object responding to <code><<</code>).
3796
+ #
3797
+ # Calling this method a second or subsequent time for the same
3798
+ # HTTPResponse object will return the value already read.
3799
+ #
3800
+ # http.request_get('/index.html') {|res|
3801
+ # puts res.read_body
3802
+ # }
3803
+ #
3804
+ # http.request_get('/index.html') {|res|
3805
+ # p res.read_body.object_id # 538149362
3806
+ # p res.read_body.object_id # 538149362
3807
+ # }
3808
+ #
3809
+ # # using iterator
3810
+ # http.request_get('/index.html') {|res|
3811
+ # res.read_body do |segment|
3812
+ # print segment
3813
+ # end
3814
+ # }
3815
+ #
3816
+ # pkg:gem/net-http#lib/net/http/response.rb:356
3817
+ def read_body(dest = T.unsafe(nil), &block); end
3818
+
3819
+ # pkg:gem/net-http#lib/net/http/response.rb:308
3820
+ def read_header; end
3821
+
3822
+ # body
3823
+ #
3824
+ # pkg:gem/net-http#lib/net/http/response.rb:317
3825
+ def reading_body(sock, reqmethodallowbody); end
3826
+
3827
+ # header (for backward compatibility only; DO NOT USE)
3828
+ #
3829
+ # pkg:gem/net-http#lib/net/http/response.rb:298
3830
+ def response; end
3831
+
3832
+ # The URI used to fetch this response. The response URI is only available
3833
+ # if a URI was used to create the request.
3834
+ #
3835
+ # pkg:gem/net-http#lib/net/http/response.rb:222
3836
+ def uri; end
3837
+
3838
+ # pkg:gem/net-http#lib/net/http/response.rb:290
3839
+ def uri=(uri); end
3840
+
3841
+ # Raises an HTTP error if the response is not 2xx (success).
3842
+ #
3843
+ # pkg:gem/net-http#lib/net/http/response.rb:286
3844
+ def value; end
3845
+
3846
+ private
3847
+
3848
+ # pkg:gem/net-http#lib/net/http/response.rb:451
3849
+ def check_bom(str); end
3850
+
3851
+ # pkg:gem/net-http#lib/net/http/response.rb:415
3852
+ def detect_encoding(str, encoding = T.unsafe(nil)); end
3853
+
3854
+ # pkg:gem/net-http#lib/net/http/response.rb:541
3855
+ def extracting_encodings_from_meta_elements(value); end
3856
+
3857
+ # pkg:gem/net-http#lib/net/http/response.rb:506
3858
+ def get_attribute(ss); end
3859
+
3860
+ # Checks for a supported Content-Encoding header and yields an Inflate
3861
+ # wrapper for this response's socket when zlib is present. If the
3862
+ # Content-Encoding is not supported or zlib is missing, the plain socket is
3863
+ # yielded.
3864
+ #
3865
+ # If a Content-Range header is present, a plain socket is yielded as the
3866
+ # bytes in the range may not be a complete deflate block.
3867
+ #
3868
+ # pkg:gem/net-http#lib/net/http/response.rb:558
3869
+ def inflater; end
3870
+
3871
+ # pkg:gem/net-http#lib/net/http/response.rb:647
3872
+ def procdest(dest, block); end
3873
+
3874
+ # pkg:gem/net-http#lib/net/http/response.rb:593
3875
+ def read_body_0(dest); end
3876
+
3877
+ # read_chunked reads from +@socket+ for chunk-size, chunk-extension, CRLF,
3878
+ # etc. and +chunk_data_io+ for chunk-data which may be deflate or gzip
3879
+ # encoded.
3880
+ #
3881
+ # See RFC 2616 section 3.6.1 for definitions
3882
+ #
3883
+ # pkg:gem/net-http#lib/net/http/response.rb:623
3884
+ def read_chunked(dest, chunk_data_io); end
3885
+
3886
+ # pkg:gem/net-http#lib/net/http/response.rb:465
3887
+ def scanning_meta(str); end
3888
+
3889
+ # pkg:gem/net-http#lib/net/http/response.rb:435
3890
+ def sniff_encoding(str, encoding = T.unsafe(nil)); end
3891
+
3892
+ # pkg:gem/net-http#lib/net/http/response.rb:643
3893
+ def stream_check; end
3894
+
3895
+ class << self
3896
+ # true if the response has a body.
3897
+ #
3898
+ # pkg:gem/net-http#lib/net/http/response.rb:138
3899
+ def body_permitted?; end
3900
+
3901
+ # pkg:gem/net-http#lib/net/http/response.rb:142
3902
+ def exception_type; end
3903
+
3904
+ # pkg:gem/net-http#lib/net/http/response.rb:146
3905
+ def read_new(sock); end
3906
+
3907
+ private
3908
+
3909
+ # pkg:gem/net-http#lib/net/http/response.rb:171
3910
+ def each_response_header(sock); end
3911
+
3912
+ # :stopdoc:
3913
+ #
3914
+ # pkg:gem/net-http#lib/net/http/response.rb:158
3915
+ def read_status_line(sock); end
3916
+
3917
+ # pkg:gem/net-http#lib/net/http/response.rb:165
3918
+ def response_class(code); end
3919
+ end
3920
+ end
3921
+
3922
+ # Inflater is a wrapper around Net::BufferedIO that transparently inflates
3923
+ # zlib and gzip streams.
3924
+ #
3925
+ # pkg:gem/net-http#lib/net/http/response.rb:661
3926
+ class Net::HTTPResponse::Inflater
3927
+ # Creates a new Inflater wrapping +socket+
3928
+ #
3929
+ # pkg:gem/net-http#lib/net/http/response.rb:666
3930
+ def initialize(socket); end
3931
+
3932
+ # The number of bytes inflated, used to update the Content-Length of
3933
+ # the response.
3934
+ #
3935
+ # pkg:gem/net-http#lib/net/http/response.rb:684
3936
+ def bytes_inflated; end
3937
+
3938
+ # Finishes the inflate stream.
3939
+ #
3940
+ # pkg:gem/net-http#lib/net/http/response.rb:675
3941
+ def finish; end
3942
+
3943
+ # Returns a Net::ReadAdapter that inflates each read chunk into +dest+.
3944
+ #
3945
+ # This allows a large response body to be inflated without storing the
3946
+ # entire body in memory.
3947
+ #
3948
+ # pkg:gem/net-http#lib/net/http/response.rb:694
3949
+ def inflate_adapter(dest); end
3950
+
3951
+ # Reads +clen+ bytes from the socket, inflates them, then writes them to
3952
+ # +dest+. +ignore_eof+ is passed down to Net::BufferedIO#read
3953
+ #
3954
+ # Unlike Net::BufferedIO#read, this method returns more than +clen+ bytes.
3955
+ # At this time there is no way for a user of Net::HTTPResponse to read a
3956
+ # specific number of bytes from the HTTP response body, so this internal
3957
+ # API does not return the same number of bytes as were requested.
3958
+ #
3959
+ # See https://bugs.ruby-lang.org/issues/6492 for further discussion.
3960
+ #
3961
+ # pkg:gem/net-http#lib/net/http/response.rb:721
3962
+ def read(clen, dest, ignore_eof = T.unsafe(nil)); end
3963
+
3964
+ # Reads the rest of the socket, inflates it, then writes it to +dest+.
3965
+ #
3966
+ # pkg:gem/net-http#lib/net/http/response.rb:730
3967
+ def read_all(dest); end
3968
+ end
3969
+
3970
+ # pkg:gem/net-http#lib/net/http/exceptions.rb:20
3971
+ class Net::HTTPRetriableError < ::Net::ProtoRetriableError
3972
+ include ::Net::HTTPExceptions
3973
+ end
3974
+
3975
+ # pkg:gem/net-http#lib/net/http/responses.rb:88
3976
+ Net::HTTPServerError::EXCEPTION_TYPE = Net::HTTPFatalError
3977
+
3978
+ # for backward compatibility until Ruby 4.0
3979
+ # https://bugs.ruby-lang.org/issues/20900
3980
+ # https://github.com/bblimke/webmock/pull/1081
3981
+ #
3982
+ # pkg:gem/net-http#lib/net/http.rb:2593
3983
+ Net::HTTPSession = Net::HTTP
3984
+
3985
+ # pkg:gem/net-http#lib/net/http/responses.rb:42
3986
+ Net::HTTPSuccess::EXCEPTION_TYPE = Net::HTTPError
3987
+
3988
+ # Response class for <tt>URI Too Long</tt> responses (status code 414).
3989
+ #
3990
+ # The URI provided was too long for the server to process.
3991
+ #
3992
+ # :include: doc/net-http/included_getters.rdoc
3993
+ #
3994
+ # References:
3995
+ #
3996
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414].
3997
+ # - {RFC 9110}[https://www.rfc-editor.org/rfc/rfc9110.html#name-414-uri-too-long].
3998
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#414].
3999
+ #
4000
+ # pkg:gem/net-http#lib/net/http/responses.rb:748
4001
+ class Net::HTTPURITooLong < ::Net::HTTPClientError; end
4002
+
4003
+ # :stopdoc:
4004
+ #
4005
+ # pkg:gem/net-http#lib/net/http/responses.rb:750
4006
+ Net::HTTPURITooLong::HAS_BODY = T.let(T.unsafe(nil), TrueClass)
4007
+
4008
+ # pkg:gem/net-http#lib/net/http/responses.rb:11
4009
+ Net::HTTPUnknownResponse::EXCEPTION_TYPE = Net::HTTPError
4010
+
4011
+ # Response class for <tt>Variant Also Negotiates</tt> responses (status code 506).
4012
+ #
4013
+ # Transparent content negotiation for the request results in a circular reference.
4014
+ #
4015
+ # :include: doc/net-http/included_getters.rdoc
4016
+ #
4017
+ # References:
4018
+ #
4019
+ # - {Mozilla}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506].
4020
+ # - {RFC 2295}[https://www.rfc-editor.org/rfc/rfc2295#section-8.1].
4021
+ # - {Wikipedia}[https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#506].
4022
+ #
4023
+ # pkg:gem/net-http#lib/net/http/responses.rb:1091
4024
+ class Net::HTTPVariantAlsoNegotiates < ::Net::HTTPServerError; end
4025
+
4026
+ # :stopdoc:
4027
+ #
4028
+ # pkg:gem/net-http#lib/net/http/responses.rb:1093
4029
+ Net::HTTPVariantAlsoNegotiates::HAS_BODY = T.let(T.unsafe(nil), TrueClass)