crapi 0.1.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +63 -0
- data/.rubocop.yml +53 -70
- data/.ruby-version +1 -1
- data/Gemfile.lock +66 -42
- data/README.md +29 -27
- data/crapi.gemspec +15 -15
- data/docs/{Crapi → CrAPI}/ArgumentError.html +15 -16
- data/docs/{Crapi → CrAPI}/BadHttpResponseError.html +15 -16
- data/docs/{Crapi → CrAPI}/Client.html +144 -174
- data/docs/{Crapi → CrAPI}/Error.html +14 -15
- data/docs/{Crapi → CrAPI}/Proxy.html +65 -89
- data/docs/CrAPI.html +157 -0
- data/docs/Net/HTTP.html +18 -23
- data/docs/_index.html +19 -19
- data/docs/class_list.html +3 -3
- data/docs/css/style.css +7 -9
- data/docs/file.README.html +68 -87
- data/docs/file_list.html +2 -2
- data/docs/frames.html +2 -2
- data/docs/index.html +68 -87
- data/docs/js/app.js +69 -3
- data/docs/method_list.html +34 -34
- data/docs/top-level-namespace.html +8 -8
- data/lib/crapi/client.rb +224 -228
- data/lib/crapi/errors.rb +7 -7
- data/lib/crapi/proxy.rb +82 -82
- data/lib/crapi/version.rb +10 -10
- data/lib/crapi.rb +3 -1
- data/spec/crapi_client_spec.rb +121 -0
- data/spec/crapi_errors_spec.rb +17 -0
- data/spec/crapi_proxy_spec.rb +121 -0
- data/spec/crapi_spec.rb +5 -0
- data/spec/spec_helper.rb +19 -0
- metadata +66 -52
- data/.travis.yml +0 -5
- data/docs/Crapi.html +0 -153
@@ -4,18 +4,18 @@
|
|
4
4
|
<meta charset="utf-8">
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
6
|
<title>
|
7
|
-
Class:
|
7
|
+
Class: CrAPI::Client
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.28
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="../css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="../css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
18
|
-
pathId = "
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "CrAPI::Client";
|
19
19
|
relpath = '../';
|
20
20
|
</script>
|
21
21
|
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<div id="menu">
|
38
38
|
|
39
39
|
<a href="../_index.html">Index (C)</a> »
|
40
|
-
<span class='title'><span class='object_link'><a href="../
|
40
|
+
<span class='title'><span class='object_link'><a href="../CrAPI.html" title="CrAPI (module)">CrAPI</a></span></span>
|
41
41
|
»
|
42
42
|
<span class="title">Client</span>
|
43
43
|
|
@@ -59,7 +59,7 @@
|
|
59
59
|
<div class="clear"></div>
|
60
60
|
</div>
|
61
61
|
|
62
|
-
<div id="content"><h1>Class:
|
62
|
+
<div id="content"><h1>Class: CrAPI::Client
|
63
63
|
|
64
64
|
|
65
65
|
|
@@ -74,7 +74,7 @@
|
|
74
74
|
<ul class="fullTree">
|
75
75
|
<li>Object</li>
|
76
76
|
|
77
|
-
<li class="next">
|
77
|
+
<li class="next">CrAPI::Client</li>
|
78
78
|
|
79
79
|
</ul>
|
80
80
|
<a href="#" class="inheritanceTree">show all</a>
|
@@ -101,9 +101,8 @@
|
|
101
101
|
|
102
102
|
<h2>Overview</h2><div class="docstring">
|
103
103
|
<div class="discussion">
|
104
|
-
|
105
|
-
<
|
106
|
-
<span class='object_link'><a href="#patch-instance_method" title="Crapi::Client#patch (method)">#patch</a></span> / <span class='object_link'><a href="#post-instance_method" title="Crapi::Client#post (method)">#post</a></span> / <span class='object_link'><a href="#put-instance_method" title="Crapi::Client#put (method)">#put</a></span>), and proxy generators.</p>
|
104
|
+
<p>Provides a connection mechanism, simple CRUD methods (<span class='object_link'><a href="#delete-instance_method" title="CrAPI::Client#delete (method)">#delete</a></span> / <span class='object_link'><a href="#get-instance_method" title="CrAPI::Client#get (method)">#get</a></span> / <span class='object_link'><a href="#patch-instance_method" title="CrAPI::Client#patch (method)">#patch</a></span> / <span class='object_link'><a href="#post-instance_method" title="CrAPI::Client#post (method)">#post</a></span> /
|
105
|
+
<span class='object_link'><a href="#put-instance_method" title="CrAPI::Client#put (method)">#put</a></span>), and proxy generators.</p>
|
107
106
|
|
108
107
|
|
109
108
|
</div>
|
@@ -112,14 +111,18 @@
|
|
112
111
|
|
113
112
|
|
114
113
|
</div>
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
<
|
119
|
-
|
114
|
+
|
115
|
+
<h2>
|
116
|
+
Constant Summary
|
117
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
118
|
+
</h2>
|
119
|
+
|
120
|
+
<dl class="constants">
|
121
|
+
|
122
|
+
<dt id="JSON_CONTENT_TYPE-constant" class="">JSON_CONTENT_TYPE =
|
123
|
+
<div class="docstring">
|
120
124
|
<div class="discussion">
|
121
|
-
|
122
|
-
<p>The content-type for JSON data.</p>
|
125
|
+
<p>The content-type for JSON data.</p>
|
123
126
|
|
124
127
|
|
125
128
|
</div>
|
@@ -128,14 +131,13 @@
|
|
128
131
|
|
129
132
|
|
130
133
|
</div>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
134
|
+
</dt>
|
135
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/json</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
136
|
+
|
137
|
+
<dt id="FORM_CONTENT_TYPE-constant" class="">FORM_CONTENT_TYPE =
|
138
|
+
<div class="docstring">
|
136
139
|
<div class="discussion">
|
137
|
-
|
138
|
-
<p>The content-type for FORM data.</p>
|
140
|
+
<p>The content-type for FORM data.</p>
|
139
141
|
|
140
142
|
|
141
143
|
</div>
|
@@ -144,10 +146,11 @@
|
|
144
146
|
|
145
147
|
|
146
148
|
</div>
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
149
|
+
</dt>
|
150
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>application/x-www-form-urlencoded</span><span class='tstring_end'>'</span></span><span class='period'>.</span><span class='id identifier rubyid_freeze'>freeze</span></pre></dd>
|
151
|
+
|
152
|
+
</dl>
|
153
|
+
|
151
154
|
|
152
155
|
|
153
156
|
|
@@ -175,9 +178,7 @@
|
|
175
178
|
|
176
179
|
|
177
180
|
|
178
|
-
<span class="summary_desc"><div class='inline'>
|
179
|
-
<p>A Hash containing headers to send with every request (unless overriden
|
180
|
-
elsewhere).</p>
|
181
|
+
<span class="summary_desc"><div class='inline'><p>A Hash containing headers to send with every request (unless overriden elsewhere).</p>
|
181
182
|
</div></span>
|
182
183
|
|
183
184
|
</li>
|
@@ -213,8 +214,7 @@ elsewhere).</p>
|
|
213
214
|
|
214
215
|
|
215
216
|
|
216
|
-
<span class="summary_desc"><div class='inline'>
|
217
|
-
<p>CRUD method: DELETE.</p>
|
217
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: DELETE.</p>
|
218
218
|
</div></span>
|
219
219
|
|
220
220
|
</li>
|
@@ -237,8 +237,7 @@ elsewhere).</p>
|
|
237
237
|
|
238
238
|
|
239
239
|
|
240
|
-
<span class="summary_desc"><div class='inline'>
|
241
|
-
<p>CRUD method: GET.</p>
|
240
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: GET.</p>
|
242
241
|
</div></span>
|
243
242
|
|
244
243
|
</li>
|
@@ -263,8 +262,7 @@ elsewhere).</p>
|
|
263
262
|
|
264
263
|
|
265
264
|
|
266
|
-
<span class="summary_desc"><div class='inline'>
|
267
|
-
<p>A new instance of Client.</p>
|
265
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of Client.</p>
|
268
266
|
</div></span>
|
269
267
|
|
270
268
|
</li>
|
@@ -273,7 +271,7 @@ elsewhere).</p>
|
|
273
271
|
<li class="public ">
|
274
272
|
<span class="summary_signature">
|
275
273
|
|
276
|
-
<a href="#new_proxy-instance_method" title="#new_proxy (instance method)">#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒
|
274
|
+
<a href="#new_proxy-instance_method" title="#new_proxy (instance method)">#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒ CrAPI::Proxy </a>
|
277
275
|
|
278
276
|
|
279
277
|
|
@@ -287,8 +285,7 @@ elsewhere).</p>
|
|
287
285
|
|
288
286
|
|
289
287
|
|
290
|
-
<span class="summary_desc"><div class='inline'>
|
291
|
-
<p>Returns a new <span class='object_link'><a href="Proxy.html" title="Crapi::Proxy (class)">Crapi::Proxy</a></span> for this client.</p>
|
288
|
+
<span class="summary_desc"><div class='inline'><p>Returns a new <span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span> for this client.</p>
|
292
289
|
</div></span>
|
293
290
|
|
294
291
|
</li>
|
@@ -311,8 +308,7 @@ elsewhere).</p>
|
|
311
308
|
|
312
309
|
|
313
310
|
|
314
|
-
<span class="summary_desc"><div class='inline'>
|
315
|
-
<p>CRUD method: PATCH.</p>
|
311
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: PATCH.</p>
|
316
312
|
</div></span>
|
317
313
|
|
318
314
|
</li>
|
@@ -335,8 +331,7 @@ elsewhere).</p>
|
|
335
331
|
|
336
332
|
|
337
333
|
|
338
|
-
<span class="summary_desc"><div class='inline'>
|
339
|
-
<p>CRUD method: POST.</p>
|
334
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: POST.</p>
|
340
335
|
</div></span>
|
341
336
|
|
342
337
|
</li>
|
@@ -359,8 +354,7 @@ elsewhere).</p>
|
|
359
354
|
|
360
355
|
|
361
356
|
|
362
|
-
<span class="summary_desc"><div class='inline'>
|
363
|
-
<p>CRUD method: PUT.</p>
|
357
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: PUT.</p>
|
364
358
|
</div></span>
|
365
359
|
|
366
360
|
</li>
|
@@ -375,7 +369,7 @@ elsewhere).</p>
|
|
375
369
|
<div class="method_details first">
|
376
370
|
<h3 class="signature first" id="initialize-instance_method">
|
377
371
|
|
378
|
-
#<strong>initialize</strong>(base_uri, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="
|
372
|
+
#<strong>initialize</strong>(base_uri, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="CrAPI::Client (class)">Client</a></span></tt>
|
379
373
|
|
380
374
|
|
381
375
|
|
@@ -383,8 +377,7 @@ elsewhere).</p>
|
|
383
377
|
|
384
378
|
</h3><div class="docstring">
|
385
379
|
<div class="discussion">
|
386
|
-
|
387
|
-
<p>Returns a new instance of Client</p>
|
380
|
+
<p>Returns a new instance of Client.</p>
|
388
381
|
|
389
382
|
|
390
383
|
</div>
|
@@ -403,10 +396,8 @@ elsewhere).</p>
|
|
403
396
|
|
404
397
|
|
405
398
|
—
|
406
|
-
<div class='inline'>
|
407
|
-
|
408
|
-
determining whether SSH is applicable, and setting the base path for
|
409
|
-
subsequent CRUD calls.</p>
|
399
|
+
<div class='inline'><p>The base URI the client should use for determining the host to connect to, determining
|
400
|
+
whether SSH is applicable, and setting the base path for subsequent CRUD calls.</p>
|
410
401
|
</div>
|
411
402
|
|
412
403
|
</li>
|
@@ -423,9 +414,7 @@ subsequent CRUD calls.</p>
|
|
423
414
|
|
424
415
|
|
425
416
|
—
|
426
|
-
<div class='inline'>
|
427
|
-
<p>Method options. All method options are <strong>optional</strong> in this
|
428
|
-
particular case.</p>
|
417
|
+
<div class='inline'><p>Method options. All method options are <strong>optional</strong> in this particular case.</p>
|
429
418
|
</div>
|
430
419
|
|
431
420
|
</li>
|
@@ -447,9 +436,8 @@ particular case.</p>
|
|
447
436
|
|
448
437
|
</span>
|
449
438
|
|
450
|
-
— <div class='inline'>
|
451
|
-
|
452
|
-
the validity of the given certificate).</p>
|
439
|
+
— <div class='inline'><p>Whether to allow insecure SSH connections (i.e. don’t attempt to verify the validity of the
|
440
|
+
given certificate).</p>
|
453
441
|
</div>
|
454
442
|
|
455
443
|
</li>
|
@@ -461,9 +449,8 @@ the validity of the given certificate).</p>
|
|
461
449
|
|
462
450
|
</span>
|
463
451
|
|
464
|
-
— <div class='inline'>
|
465
|
-
|
466
|
-
target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
452
|
+
— <div class='inline'><p>The DNS name or IP address of a proxy server to use when connecting to the target system.
|
453
|
+
Maps to <code>Net::HTTP#new</code>’s <em>p_addr</em>.</p>
|
467
454
|
</div>
|
468
455
|
|
469
456
|
</li>
|
@@ -475,9 +462,8 @@ target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
|
475
462
|
|
476
463
|
</span>
|
477
464
|
|
478
|
-
— <div class='inline'>
|
479
|
-
|
480
|
-
<code>Net::HTTP#new</code>'s <em>p_port</em>.</p>
|
465
|
+
— <div class='inline'><p>The proxy server port to use when connecting to the target system.
|
466
|
+
Maps to <code>Net::HTTP#new</code>’s <em>p_port</em>.</p>
|
481
467
|
</div>
|
482
468
|
|
483
469
|
</li>
|
@@ -489,9 +475,8 @@ target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
|
489
475
|
|
490
476
|
</span>
|
491
477
|
|
492
|
-
— <div class='inline'>
|
493
|
-
|
494
|
-
proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_user</em>.</p>
|
478
|
+
— <div class='inline'><p>The username to give if authorization is required to access the specified proxy host.
|
479
|
+
Maps to <code>Net::HTTP#new</code>’s <em>p_user</em>.</p>
|
495
480
|
</div>
|
496
481
|
|
497
482
|
</li>
|
@@ -503,9 +488,8 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_user</em>.</p>
|
|
503
488
|
|
504
489
|
</span>
|
505
490
|
|
506
|
-
— <div class='inline'>
|
507
|
-
|
508
|
-
proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
491
|
+
— <div class='inline'><p>The password to give if authorization is required to access the specified proxy host.
|
492
|
+
Maps to <code>Net::HTTP#new</code>’s <em>p_pass</em>.</p>
|
509
493
|
</div>
|
510
494
|
|
511
495
|
</li>
|
@@ -519,7 +503,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
519
503
|
<li>
|
520
504
|
|
521
505
|
|
522
|
-
<span class='type'>(<tt><span class='object_link'><a href="ArgumentError.html" title="
|
506
|
+
<span class='type'>(<tt><span class='object_link'><a href="ArgumentError.html" title="CrAPI::ArgumentError (class)">CrAPI::ArgumentError</a></span></tt>)</span>
|
523
507
|
|
524
508
|
|
525
509
|
|
@@ -560,7 +544,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
560
544
|
<span class='ivar'>@base_uri</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_base_uri'>base_uri</span>
|
561
545
|
<span class='kw'>when</span> <span class='const'>URI</span> <span class='kw'>then</span> <span class='id identifier rubyid_base_uri'>base_uri</span>
|
562
546
|
<span class='kw'>when</span> <span class='const'>String</span> <span class='kw'>then</span> <span class='const'>URI</span><span class='lparen'>(</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='rparen'>)</span>
|
563
|
-
<span class='kw'>else</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../
|
547
|
+
<span class='kw'>else</span> <span class='id identifier rubyid_raise'>raise</span> <span class='const'><span class='object_link'><a href="../CrAPI.html" title="CrAPI (module)">CrAPI</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ArgumentError.html" title="CrAPI::ArgumentError (class)">ArgumentError</a></span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>%(</span><span class='tstring_content'>Unexpected "base_uri" type: </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base_uri'>base_uri</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>)</span></span>
|
564
548
|
<span class='kw'>end</span>
|
565
549
|
|
566
550
|
<span class='ivar'>@proxy_host</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:proxy_host</span><span class='rbracket'>]</span>
|
@@ -573,7 +557,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
573
557
|
<span class='ivar'>@http</span><span class='period'>.</span><span class='id identifier rubyid_use_ssl'>use_ssl</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='ivar'>@base_uri</span><span class='period'>.</span><span class='id identifier rubyid_scheme'>scheme</span> <span class='op'>==</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
574
558
|
<span class='ivar'>@http</span><span class='period'>.</span><span class='id identifier rubyid_verify_mode'>verify_mode</span> <span class='op'>=</span> <span class='op'>::</span><span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>SSL</span><span class='op'>::</span><span class='const'>VERIFY_NONE</span> <span class='kw'>if</span> <span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:insecure</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span>
|
575
559
|
|
576
|
-
<span class='ivar'>@default_headers</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content-Type</span><span class='label_end'>':</span> <span class='const'><span class='object_link'><a href="#JSON_CONTENT_TYPE-constant" title="
|
560
|
+
<span class='ivar'>@default_headers</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Content-Type</span><span class='label_end'>':</span> <span class='const'><span class='object_link'><a href="#JSON_CONTENT_TYPE-constant" title="CrAPI::Client::JSON_CONTENT_TYPE (constant)">JSON_CONTENT_TYPE</a></span></span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_with_indifferent_access'>with_indifferent_access</span>
|
577
561
|
<span class='kw'>end</span></pre>
|
578
562
|
</td>
|
579
563
|
</tr>
|
@@ -598,10 +582,9 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
598
582
|
|
599
583
|
</h3><div class="docstring">
|
600
584
|
<div class="discussion">
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
<em>headers</em> still override any conflicting default header.</p>
|
585
|
+
<p>A Hash containing headers to send with every request (unless overriden elsewhere). Headers
|
586
|
+
set by the user via the CRUD methods’ <em>headers</em> still override any conflicting default
|
587
|
+
header.</p>
|
605
588
|
|
606
589
|
|
607
590
|
</div>
|
@@ -648,8 +631,7 @@ elsewhere). Headers set by the user via the CRUD methods'
|
|
648
631
|
|
649
632
|
</h3><div class="docstring">
|
650
633
|
<div class="discussion">
|
651
|
-
|
652
|
-
<p>CRUD method: DELETE</p>
|
634
|
+
<p>CRUD method: DELETE</p>
|
653
635
|
|
654
636
|
|
655
637
|
</div>
|
@@ -668,10 +650,8 @@ elsewhere). Headers set by the user via the CRUD methods'
|
|
668
650
|
|
669
651
|
|
670
652
|
—
|
671
|
-
<div class='inline'>
|
672
|
-
|
673
|
-
interpreted as relative to the client's base_uri's path, regardless
|
674
|
-
of whether it begins with a “/”.</p>
|
653
|
+
<div class='inline'><p>The path to the resource to DELETE. Note that this path is always interpreted as relative
|
654
|
+
to the client’s base_uri’s path, regardless of whether it begins with a “/”.</p>
|
675
655
|
</div>
|
676
656
|
|
677
657
|
</li>
|
@@ -684,12 +664,12 @@ of whether it begins with a “/”.</p>
|
|
684
664
|
<span class='type'>(<tt>Hash</tt>)</span>
|
685
665
|
|
686
666
|
|
667
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
668
|
+
|
687
669
|
|
688
670
|
—
|
689
|
-
<div class='inline'>
|
690
|
-
|
691
|
-
header given here and also appearing in the client's defaults will
|
692
|
-
override said default value.</p>
|
671
|
+
<div class='inline'><p>Additional headers to set in addition to the client’s defaults. Any header given here and
|
672
|
+
also appearing in the client’s defaults will override said default value.</p>
|
693
673
|
</div>
|
694
674
|
|
695
675
|
</li>
|
@@ -702,12 +682,12 @@ override said default value.</p>
|
|
702
682
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
703
683
|
|
704
684
|
|
685
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
686
|
+
|
705
687
|
|
706
688
|
—
|
707
|
-
<div class='inline'>
|
708
|
-
|
709
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
710
|
-
before appending.</p>
|
689
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
690
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p>
|
711
691
|
</div>
|
712
692
|
|
713
693
|
</li>
|
@@ -768,8 +748,7 @@ before appending.</p>
|
|
768
748
|
|
769
749
|
</h3><div class="docstring">
|
770
750
|
<div class="discussion">
|
771
|
-
|
772
|
-
<p>CRUD method: GET</p>
|
751
|
+
<p>CRUD method: GET</p>
|
773
752
|
|
774
753
|
|
775
754
|
</div>
|
@@ -788,10 +767,8 @@ before appending.</p>
|
|
788
767
|
|
789
768
|
|
790
769
|
—
|
791
|
-
<div class='inline'>
|
792
|
-
|
793
|
-
as relative to the client's base_uri's path, regardless of whether
|
794
|
-
it begins with a “/”.</p>
|
770
|
+
<div class='inline'><p>The path to the resource to GET. Note that this path is always interpreted as relative to
|
771
|
+
the client’s base_uri’s path, regardless of whether it begins with a “/”.</p>
|
795
772
|
</div>
|
796
773
|
|
797
774
|
</li>
|
@@ -804,12 +781,12 @@ it begins with a “/”.</p>
|
|
804
781
|
<span class='type'>(<tt>Hash</tt>)</span>
|
805
782
|
|
806
783
|
|
784
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
785
|
+
|
807
786
|
|
808
787
|
—
|
809
|
-
<div class='inline'>
|
810
|
-
|
811
|
-
header given here and also appearing in the client's defaults will
|
812
|
-
override said default value.</p>
|
788
|
+
<div class='inline'><p>Additional headers to set in addition to the client’s defaults. Any header given here and
|
789
|
+
also appearing in the client’s defaults will override said default value.</p>
|
813
790
|
</div>
|
814
791
|
|
815
792
|
</li>
|
@@ -822,12 +799,12 @@ override said default value.</p>
|
|
822
799
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
823
800
|
|
824
801
|
|
802
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
803
|
+
|
825
804
|
|
826
805
|
—
|
827
|
-
<div class='inline'>
|
828
|
-
|
829
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
830
|
-
before appending.</p>
|
806
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
807
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p>
|
831
808
|
</div>
|
832
809
|
|
833
810
|
</li>
|
@@ -880,7 +857,7 @@ before appending.</p>
|
|
880
857
|
<div class="method_details ">
|
881
858
|
<h3 class="signature " id="new_proxy-instance_method">
|
882
859
|
|
883
|
-
#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒ <tt><span class='object_link'><a href="Proxy.html" title="
|
860
|
+
#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒ <tt><span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span></tt>
|
884
861
|
|
885
862
|
|
886
863
|
|
@@ -888,8 +865,7 @@ before appending.</p>
|
|
888
865
|
|
889
866
|
</h3><div class="docstring">
|
890
867
|
<div class="discussion">
|
891
|
-
|
892
|
-
<p>Returns a new <span class='object_link'><a href="Proxy.html" title="Crapi::Proxy (class)">Crapi::Proxy</a></span> for this client.</p>
|
868
|
+
<p>Returns a new <span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span> for this client.</p>
|
893
869
|
|
894
870
|
|
895
871
|
</div>
|
@@ -910,8 +886,7 @@ before appending.</p>
|
|
910
886
|
|
911
887
|
|
912
888
|
—
|
913
|
-
<div class='inline'>
|
914
|
-
<p>The segment to add to this client's path.</p>
|
889
|
+
<div class='inline'><p>The segment to add to this client’s path.</p>
|
915
890
|
</div>
|
916
891
|
|
917
892
|
</li>
|
@@ -924,10 +899,11 @@ before appending.</p>
|
|
924
899
|
<span class='type'>(<tt>Hash</tt>)</span>
|
925
900
|
|
926
901
|
|
902
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
903
|
+
|
927
904
|
|
928
905
|
—
|
929
|
-
<div class='inline'>
|
930
|
-
<p>The default headers for the new proxy.</p>
|
906
|
+
<div class='inline'><p>The default headers for the new proxy.</p>
|
931
907
|
</div>
|
932
908
|
|
933
909
|
</li>
|
@@ -940,7 +916,7 @@ before appending.</p>
|
|
940
916
|
<li>
|
941
917
|
|
942
918
|
|
943
|
-
<span class='type'>(<tt><span class='object_link'><a href="Proxy.html" title="
|
919
|
+
<span class='type'>(<tt><span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span></tt>)</span>
|
944
920
|
|
945
921
|
|
946
922
|
|
@@ -962,7 +938,7 @@ before appending.</p>
|
|
962
938
|
<pre class="code"><span class="info file"># File 'lib/crapi/client.rb', line 89</span>
|
963
939
|
|
964
940
|
<span class='kw'>def</span> <span class='id identifier rubyid_new_proxy'>new_proxy</span><span class='lparen'>(</span><span class='id identifier rubyid_segment'>segment</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
965
|
-
<span class='const'><span class='object_link'><a href="Proxy.html" title="
|
941
|
+
<span class='const'><span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">Proxy</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Proxy.html#initialize-instance_method" title="CrAPI::Proxy#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>add:</span> <span class='id identifier rubyid_segment'>segment</span><span class='comma'>,</span> <span class='label'>to:</span> <span class='kw'>self</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
966
942
|
<span class='kw'>end</span></pre>
|
967
943
|
</td>
|
968
944
|
</tr>
|
@@ -980,8 +956,7 @@ before appending.</p>
|
|
980
956
|
|
981
957
|
</h3><div class="docstring">
|
982
958
|
<div class="discussion">
|
983
|
-
|
984
|
-
<p>CRUD method: PATCH</p>
|
959
|
+
<p>CRUD method: PATCH</p>
|
985
960
|
|
986
961
|
|
987
962
|
</div>
|
@@ -1000,10 +975,8 @@ before appending.</p>
|
|
1000
975
|
|
1001
976
|
|
1002
977
|
—
|
1003
|
-
<div class='inline'>
|
1004
|
-
|
1005
|
-
interpreted as relative to the client's base_uri's path, regardless
|
1006
|
-
of whether it begins with a “/”.</p>
|
978
|
+
<div class='inline'><p>The path to the resource to PATCH. Note that this path is always interpreted as relative to
|
979
|
+
the client’s base_uri’s path, regardless of whether it begins with a “/”.</p>
|
1007
980
|
</div>
|
1008
981
|
|
1009
982
|
</li>
|
@@ -1016,12 +989,12 @@ of whether it begins with a “/”.</p>
|
|
1016
989
|
<span class='type'>(<tt>Hash</tt>)</span>
|
1017
990
|
|
1018
991
|
|
992
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
993
|
+
|
1019
994
|
|
1020
995
|
—
|
1021
|
-
<div class='inline'>
|
1022
|
-
|
1023
|
-
header given here and also appearing in the client's defaults will
|
1024
|
-
override said default value.</p>
|
996
|
+
<div class='inline'><p>Additional headers to set in addition to the client’s defaults. Any header given here and
|
997
|
+
also appearing in the client’s defaults will override said default value.</p>
|
1025
998
|
</div>
|
1026
999
|
|
1027
1000
|
</li>
|
@@ -1034,12 +1007,12 @@ override said default value.</p>
|
|
1034
1007
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
1035
1008
|
|
1036
1009
|
|
1010
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1011
|
+
|
1037
1012
|
|
1038
1013
|
—
|
1039
|
-
<div class='inline'>
|
1040
|
-
|
1041
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
1042
|
-
before appending.</p>
|
1014
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
1015
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p>
|
1043
1016
|
</div>
|
1044
1017
|
|
1045
1018
|
</li>
|
@@ -1052,11 +1025,12 @@ before appending.</p>
|
|
1052
1025
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
1053
1026
|
|
1054
1027
|
|
1028
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1029
|
+
|
1055
1030
|
|
1056
1031
|
—
|
1057
|
-
<div class='inline'>
|
1058
|
-
|
1059
|
-
per the request's “Content-Type” header.</p>
|
1032
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
1033
|
+
request’s “Content-Type” header.</p>
|
1060
1034
|
</div>
|
1061
1035
|
|
1062
1036
|
</li>
|
@@ -1097,7 +1071,7 @@ per the request's “Content-Type” header.</p>
|
|
1097
1071
|
|
1098
1072
|
<span class='kw'>def</span> <span class='id identifier rubyid_patch'>patch</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1099
1073
|
<span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='ivar'>@default_headers</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1100
|
-
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'
|
1074
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:'Content-Type'</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1101
1075
|
|
1102
1076
|
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@http</span><span class='period'>.</span><span class='id identifier rubyid_patch'>patch</span><span class='lparen'>(</span><span class='id identifier rubyid_full_path'>full_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1103
1077
|
<span class='id identifier rubyid_ensure_success!'>ensure_success!</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
@@ -1119,8 +1093,7 @@ per the request's “Content-Type” header.</p>
|
|
1119
1093
|
|
1120
1094
|
</h3><div class="docstring">
|
1121
1095
|
<div class="discussion">
|
1122
|
-
|
1123
|
-
<p>CRUD method: POST</p>
|
1096
|
+
<p>CRUD method: POST</p>
|
1124
1097
|
|
1125
1098
|
|
1126
1099
|
</div>
|
@@ -1139,10 +1112,8 @@ per the request's “Content-Type” header.</p>
|
|
1139
1112
|
|
1140
1113
|
|
1141
1114
|
—
|
1142
|
-
<div class='inline'>
|
1143
|
-
|
1144
|
-
as relative to the client's base_uri's path, regardless of whether
|
1145
|
-
it begins with a “/”.</p>
|
1115
|
+
<div class='inline'><p>The path to the resource to POST. Note that this path is always interpreted as relative to
|
1116
|
+
the client’s base_uri’s path, regardless of whether it begins with a “/”.</p>
|
1146
1117
|
</div>
|
1147
1118
|
|
1148
1119
|
</li>
|
@@ -1155,12 +1126,12 @@ it begins with a “/”.</p>
|
|
1155
1126
|
<span class='type'>(<tt>Hash</tt>)</span>
|
1156
1127
|
|
1157
1128
|
|
1129
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1130
|
+
|
1158
1131
|
|
1159
1132
|
—
|
1160
|
-
<div class='inline'>
|
1161
|
-
|
1162
|
-
header given here and also appearing in the client's defaults will
|
1163
|
-
override said default value.</p>
|
1133
|
+
<div class='inline'><p>Additional headers to set in addition to the client’s defaults. Any header given here and
|
1134
|
+
also appearing in the client’s defaults will override said default value.</p>
|
1164
1135
|
</div>
|
1165
1136
|
|
1166
1137
|
</li>
|
@@ -1173,12 +1144,12 @@ override said default value.</p>
|
|
1173
1144
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
1174
1145
|
|
1175
1146
|
|
1147
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1148
|
+
|
1176
1149
|
|
1177
1150
|
—
|
1178
|
-
<div class='inline'>
|
1179
|
-
|
1180
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
1181
|
-
before appending.</p>
|
1151
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
1152
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p>
|
1182
1153
|
</div>
|
1183
1154
|
|
1184
1155
|
</li>
|
@@ -1191,11 +1162,12 @@ before appending.</p>
|
|
1191
1162
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
1192
1163
|
|
1193
1164
|
|
1165
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1166
|
+
|
1194
1167
|
|
1195
1168
|
—
|
1196
|
-
<div class='inline'>
|
1197
|
-
|
1198
|
-
per the request's “Content-Type” header.</p>
|
1169
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
1170
|
+
request’s “Content-Type” header.</p>
|
1199
1171
|
</div>
|
1200
1172
|
|
1201
1173
|
</li>
|
@@ -1236,7 +1208,7 @@ per the request's “Content-Type” header.</p>
|
|
1236
1208
|
|
1237
1209
|
<span class='kw'>def</span> <span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1238
1210
|
<span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='ivar'>@default_headers</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1239
|
-
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'
|
1211
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:'Content-Type'</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1240
1212
|
|
1241
1213
|
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@http</span><span class='period'>.</span><span class='id identifier rubyid_post'>post</span><span class='lparen'>(</span><span class='id identifier rubyid_full_path'>full_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1242
1214
|
<span class='id identifier rubyid_ensure_success!'>ensure_success!</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
@@ -1258,8 +1230,7 @@ per the request's “Content-Type” header.</p>
|
|
1258
1230
|
|
1259
1231
|
</h3><div class="docstring">
|
1260
1232
|
<div class="discussion">
|
1261
|
-
|
1262
|
-
<p>CRUD method: PUT</p>
|
1233
|
+
<p>CRUD method: PUT</p>
|
1263
1234
|
|
1264
1235
|
|
1265
1236
|
</div>
|
@@ -1278,10 +1249,8 @@ per the request's “Content-Type” header.</p>
|
|
1278
1249
|
|
1279
1250
|
|
1280
1251
|
—
|
1281
|
-
<div class='inline'>
|
1282
|
-
|
1283
|
-
interpreted as relative to the client's base_uri's path, regardless
|
1284
|
-
of whether it begins with a “/”.</p>
|
1252
|
+
<div class='inline'><p>The path to the resource to PATCH. Note that this path is always interpreted as relative to
|
1253
|
+
the client’s base_uri’s path, regardless of whether it begins with a “/”.</p>
|
1285
1254
|
</div>
|
1286
1255
|
|
1287
1256
|
</li>
|
@@ -1294,12 +1263,12 @@ of whether it begins with a “/”.</p>
|
|
1294
1263
|
<span class='type'>(<tt>Hash</tt>)</span>
|
1295
1264
|
|
1296
1265
|
|
1266
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1267
|
+
|
1297
1268
|
|
1298
1269
|
—
|
1299
|
-
<div class='inline'>
|
1300
|
-
|
1301
|
-
header given here and also appearing in the client's defaults will
|
1302
|
-
override said default value.</p>
|
1270
|
+
<div class='inline'><p>Additional headers to set in addition to the client’s defaults. Any header given here and
|
1271
|
+
also appearing in the client’s defaults will override said default value.</p>
|
1303
1272
|
</div>
|
1304
1273
|
|
1305
1274
|
</li>
|
@@ -1312,12 +1281,12 @@ override said default value.</p>
|
|
1312
1281
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
1313
1282
|
|
1314
1283
|
|
1284
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1285
|
+
|
1315
1286
|
|
1316
1287
|
—
|
1317
|
-
<div class='inline'>
|
1318
|
-
|
1319
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
1320
|
-
before appending.</p>
|
1288
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
1289
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p>
|
1321
1290
|
</div>
|
1322
1291
|
|
1323
1292
|
</li>
|
@@ -1330,11 +1299,12 @@ before appending.</p>
|
|
1330
1299
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
1331
1300
|
|
1332
1301
|
|
1302
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1303
|
+
|
1333
1304
|
|
1334
1305
|
—
|
1335
|
-
<div class='inline'>
|
1336
|
-
|
1337
|
-
per the request's “Content-Type” header.</p>
|
1306
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
1307
|
+
request’s “Content-Type” header.</p>
|
1338
1308
|
</div>
|
1339
1309
|
|
1340
1310
|
</li>
|
@@ -1375,7 +1345,7 @@ per the request's “Content-Type” header.</p>
|
|
1375
1345
|
|
1376
1346
|
<span class='kw'>def</span> <span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>headers:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='label'>payload:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1377
1347
|
<span class='id identifier rubyid_headers'>headers</span> <span class='op'>=</span> <span class='ivar'>@default_headers</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span><span class='lparen'>(</span><span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1378
|
-
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'
|
1348
|
+
<span class='id identifier rubyid_payload'>payload</span> <span class='op'>=</span> <span class='id identifier rubyid_format_payload'>format_payload</span><span class='lparen'>(</span><span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='label'>as:</span> <span class='id identifier rubyid_headers'>headers</span><span class='lbracket'>[</span><span class='symbol'>:'Content-Type'</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1379
1349
|
|
1380
1350
|
<span class='id identifier rubyid_response'>response</span> <span class='op'>=</span> <span class='ivar'>@http</span><span class='period'>.</span><span class='id identifier rubyid_put'>put</span><span class='lparen'>(</span><span class='id identifier rubyid_full_path'>full_path</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_payload'>payload</span><span class='comma'>,</span> <span class='id identifier rubyid_headers'>headers</span><span class='rparen'>)</span>
|
1381
1351
|
<span class='id identifier rubyid_ensure_success!'>ensure_success!</span><span class='lparen'>(</span><span class='id identifier rubyid_response'>response</span><span class='rparen'>)</span>
|
@@ -1391,9 +1361,9 @@ per the request's “Content-Type” header.</p>
|
|
1391
1361
|
</div>
|
1392
1362
|
|
1393
1363
|
<div id="footer">
|
1394
|
-
Generated on
|
1395
|
-
<a href="
|
1396
|
-
0.9.
|
1364
|
+
Generated on Mon Jan 2 15:16:45 2023 by
|
1365
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1366
|
+
0.9.28 (ruby-3.0.4).
|
1397
1367
|
</div>
|
1398
1368
|
|
1399
1369
|
</div>
|