expo_notifier 0.1.0

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