crapi 0.1.3 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +64 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +53 -70
- data/.ruby-version +1 -1
- data/Gemfile.lock +138 -43
- data/README.md +29 -27
- data/crapi.gemspec +17 -17
- data/docs/{Crapi → CrAPI}/ArgumentError.html +21 -19
- data/docs/{Crapi → CrAPI}/BadHttpResponseError.html +21 -19
- data/docs/{Crapi → CrAPI}/Client.html +150 -222
- data/docs/{Crapi → CrAPI}/Error.html +19 -18
- data/docs/{Crapi → CrAPI}/Proxy.html +71 -114
- data/docs/CrAPI.html +157 -0
- data/docs/Net/HTTP.html +24 -29
- data/docs/_index.html +22 -20
- data/docs/class_list.html +10 -7
- data/docs/css/common.css +1 -1
- data/docs/css/full_list.css +201 -53
- data/docs/css/style.css +991 -401
- data/docs/file.README.html +51 -94
- data/docs/file_list.html +9 -6
- data/docs/frames.html +11 -6
- data/docs/index.html +51 -94
- data/docs/js/app.js +799 -246
- data/docs/js/full_list.js +332 -214
- data/docs/method_list.html +41 -38
- data/docs/top-level-namespace.html +11 -9
- 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
- metadata +56 -55
- 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.44
|
|
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
|
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
|
|
28
28
|
</head>
|
|
29
29
|
<body>
|
|
30
|
+
<div id="main_progress" aria-hidden="true"></div>
|
|
31
|
+
|
|
30
32
|
<div class="nav_wrap">
|
|
31
33
|
<iframe id="nav" src="../class_list.html?1"></iframe>
|
|
32
34
|
<div id="resizer"></div>
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
<div id="menu">
|
|
38
40
|
|
|
39
41
|
<a href="../_index.html">Index (C)</a> »
|
|
40
|
-
<span class='title'><span class='object_link'><a href="../
|
|
42
|
+
<span class='title'><span class='object_link'><a href="../CrAPI.html" title="CrAPI (module)">CrAPI</a></span></span>
|
|
41
43
|
»
|
|
42
44
|
<span class="title">Client</span>
|
|
43
45
|
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
<div class="clear"></div>
|
|
60
62
|
</div>
|
|
61
63
|
|
|
62
|
-
<div id="content"><h1>Class:
|
|
64
|
+
<div id="content"><h1>Class: CrAPI::Client
|
|
63
65
|
|
|
64
66
|
|
|
65
67
|
|
|
@@ -74,7 +76,7 @@
|
|
|
74
76
|
<ul class="fullTree">
|
|
75
77
|
<li>Object</li>
|
|
76
78
|
|
|
77
|
-
<li class="next">
|
|
79
|
+
<li class="next">CrAPI::Client</li>
|
|
78
80
|
|
|
79
81
|
</ul>
|
|
80
82
|
<a href="#" class="inheritanceTree">show all</a>
|
|
@@ -94,17 +96,16 @@
|
|
|
94
96
|
|
|
95
97
|
<dl>
|
|
96
98
|
<dt>Defined in:</dt>
|
|
97
|
-
<dd>lib/crapi/client.rb
|
|
99
|
+
<dd>lib/crapi/client.rb
|
|
100
|
+
</dd>
|
|
98
101
|
</dl>
|
|
99
102
|
|
|
100
103
|
</div>
|
|
101
104
|
|
|
102
105
|
<h2>Overview</h2><div class="docstring">
|
|
103
106
|
<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>
|
|
107
|
-
|
|
107
|
+
<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> /
|
|
108
|
+
<span class='object_link'><a href="#put-instance_method" title="CrAPI::Client#put (method)">#put</a></span>), and proxy generators.</p>
|
|
108
109
|
|
|
109
110
|
</div>
|
|
110
111
|
</div>
|
|
@@ -112,15 +113,18 @@
|
|
|
112
113
|
|
|
113
114
|
|
|
114
115
|
</div>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
<div class="discussion">
|
|
121
|
-
|
|
122
|
-
<p>The content-type for JSON data.</p>
|
|
116
|
+
|
|
117
|
+
<h2>
|
|
118
|
+
Constant Summary
|
|
119
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
|
120
|
+
</h2>
|
|
123
121
|
|
|
122
|
+
<dl class="constants">
|
|
123
|
+
|
|
124
|
+
<dt id="JSON_CONTENT_TYPE-constant" class="">JSON_CONTENT_TYPE =
|
|
125
|
+
<div class="docstring">
|
|
126
|
+
<div class="discussion">
|
|
127
|
+
<p>The content-type for JSON data.</p>
|
|
124
128
|
|
|
125
129
|
</div>
|
|
126
130
|
</div>
|
|
@@ -128,15 +132,13 @@
|
|
|
128
132
|
|
|
129
133
|
|
|
130
134
|
</div>
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
</dt>
|
|
136
|
+
<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>
|
|
137
|
+
|
|
138
|
+
<dt id="FORM_CONTENT_TYPE-constant" class="">FORM_CONTENT_TYPE =
|
|
139
|
+
<div class="docstring">
|
|
136
140
|
<div class="discussion">
|
|
137
|
-
|
|
138
|
-
<p>The content-type for FORM data.</p>
|
|
139
|
-
|
|
141
|
+
<p>The content-type for FORM data.</p>
|
|
140
142
|
|
|
141
143
|
</div>
|
|
142
144
|
</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,10 +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
|
-
</div></span>
|
|
181
|
+
<span class="summary_desc"><div class='inline'><p>A Hash containing headers to send with every request (unless overriden elsewhere).</p></div></span>
|
|
182
182
|
|
|
183
183
|
</li>
|
|
184
184
|
|
|
@@ -213,9 +213,7 @@ elsewhere).</p>
|
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
|
|
216
|
-
<span class="summary_desc"><div class='inline'>
|
|
217
|
-
<p>CRUD method: DELETE.</p>
|
|
218
|
-
</div></span>
|
|
216
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: DELETE.</p></div></span>
|
|
219
217
|
|
|
220
218
|
</li>
|
|
221
219
|
|
|
@@ -237,9 +235,7 @@ elsewhere).</p>
|
|
|
237
235
|
|
|
238
236
|
|
|
239
237
|
|
|
240
|
-
<span class="summary_desc"><div class='inline'>
|
|
241
|
-
<p>CRUD method: GET.</p>
|
|
242
|
-
</div></span>
|
|
238
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: GET.</p></div></span>
|
|
243
239
|
|
|
244
240
|
</li>
|
|
245
241
|
|
|
@@ -263,9 +259,7 @@ elsewhere).</p>
|
|
|
263
259
|
|
|
264
260
|
|
|
265
261
|
|
|
266
|
-
<span class="summary_desc"><div class='inline'>
|
|
267
|
-
<p>A new instance of Client.</p>
|
|
268
|
-
</div></span>
|
|
262
|
+
<span class="summary_desc"><div class='inline'><p>A new instance of Client.</p></div></span>
|
|
269
263
|
|
|
270
264
|
</li>
|
|
271
265
|
|
|
@@ -273,7 +267,7 @@ elsewhere).</p>
|
|
|
273
267
|
<li class="public ">
|
|
274
268
|
<span class="summary_signature">
|
|
275
269
|
|
|
276
|
-
<a href="#new_proxy-instance_method" title="#new_proxy (instance method)">#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒
|
|
270
|
+
<a href="#new_proxy-instance_method" title="#new_proxy (instance method)">#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒ CrAPI::Proxy </a>
|
|
277
271
|
|
|
278
272
|
|
|
279
273
|
|
|
@@ -287,9 +281,7 @@ elsewhere).</p>
|
|
|
287
281
|
|
|
288
282
|
|
|
289
283
|
|
|
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>
|
|
292
|
-
</div></span>
|
|
284
|
+
<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></div></span>
|
|
293
285
|
|
|
294
286
|
</li>
|
|
295
287
|
|
|
@@ -311,9 +303,7 @@ elsewhere).</p>
|
|
|
311
303
|
|
|
312
304
|
|
|
313
305
|
|
|
314
|
-
<span class="summary_desc"><div class='inline'>
|
|
315
|
-
<p>CRUD method: PATCH.</p>
|
|
316
|
-
</div></span>
|
|
306
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: PATCH.</p></div></span>
|
|
317
307
|
|
|
318
308
|
</li>
|
|
319
309
|
|
|
@@ -335,9 +325,7 @@ elsewhere).</p>
|
|
|
335
325
|
|
|
336
326
|
|
|
337
327
|
|
|
338
|
-
<span class="summary_desc"><div class='inline'>
|
|
339
|
-
<p>CRUD method: POST.</p>
|
|
340
|
-
</div></span>
|
|
328
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: POST.</p></div></span>
|
|
341
329
|
|
|
342
330
|
</li>
|
|
343
331
|
|
|
@@ -359,14 +347,13 @@ elsewhere).</p>
|
|
|
359
347
|
|
|
360
348
|
|
|
361
349
|
|
|
362
|
-
<span class="summary_desc"><div class='inline'>
|
|
363
|
-
<p>CRUD method: PUT.</p>
|
|
364
|
-
</div></span>
|
|
350
|
+
<span class="summary_desc"><div class='inline'><p>CRUD method: PUT.</p></div></span>
|
|
365
351
|
|
|
366
352
|
</li>
|
|
367
353
|
|
|
368
354
|
|
|
369
355
|
</ul>
|
|
356
|
+
|
|
370
357
|
|
|
371
358
|
|
|
372
359
|
<div id="constructor_details" class="method_details_list">
|
|
@@ -375,7 +362,7 @@ elsewhere).</p>
|
|
|
375
362
|
<div class="method_details first">
|
|
376
363
|
<h3 class="signature first" id="initialize-instance_method">
|
|
377
364
|
|
|
378
|
-
#<strong>initialize</strong>(base_uri, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="
|
|
365
|
+
#<strong>initialize</strong>(base_uri, opts = {}) ⇒ <tt><span class='object_link'><a href="" title="CrAPI::Client (class)">Client</a></span></tt>
|
|
379
366
|
|
|
380
367
|
|
|
381
368
|
|
|
@@ -383,9 +370,7 @@ elsewhere).</p>
|
|
|
383
370
|
|
|
384
371
|
</h3><div class="docstring">
|
|
385
372
|
<div class="discussion">
|
|
386
|
-
|
|
387
|
-
<p>Returns a new instance of Client</p>
|
|
388
|
-
|
|
373
|
+
<p>Returns a new instance of Client.</p>
|
|
389
374
|
|
|
390
375
|
</div>
|
|
391
376
|
</div>
|
|
@@ -403,11 +388,8 @@ elsewhere).</p>
|
|
|
403
388
|
|
|
404
389
|
|
|
405
390
|
—
|
|
406
|
-
<div class='inline'>
|
|
407
|
-
|
|
408
|
-
determining whether SSH is applicable, and setting the base path for
|
|
409
|
-
subsequent CRUD calls.</p>
|
|
410
|
-
</div>
|
|
391
|
+
<div class='inline'><p>The base URI the client should use for determining the host to connect to, determining
|
|
392
|
+
whether SSH is applicable, and setting the base path for subsequent CRUD calls.</p></div>
|
|
411
393
|
|
|
412
394
|
</li>
|
|
413
395
|
|
|
@@ -423,10 +405,7 @@ subsequent CRUD calls.</p>
|
|
|
423
405
|
|
|
424
406
|
|
|
425
407
|
—
|
|
426
|
-
<div class='inline'>
|
|
427
|
-
<p>Method options. All method options are <strong>optional</strong> in this
|
|
428
|
-
particular case.</p>
|
|
429
|
-
</div>
|
|
408
|
+
<div class='inline'><p>Method options. All method options are <strong>optional</strong> in this particular case.</p></div>
|
|
430
409
|
|
|
431
410
|
</li>
|
|
432
411
|
|
|
@@ -447,10 +426,8 @@ particular case.</p>
|
|
|
447
426
|
|
|
448
427
|
</span>
|
|
449
428
|
|
|
450
|
-
— <div class='inline'>
|
|
451
|
-
|
|
452
|
-
the validity of the given certificate).</p>
|
|
453
|
-
</div>
|
|
429
|
+
— <div class='inline'><p>Whether to allow insecure SSH connections (i.e. don't attempt to verify the validity of the
|
|
430
|
+
given certificate).</p></div>
|
|
454
431
|
|
|
455
432
|
</li>
|
|
456
433
|
|
|
@@ -461,10 +438,8 @@ the validity of the given certificate).</p>
|
|
|
461
438
|
|
|
462
439
|
</span>
|
|
463
440
|
|
|
464
|
-
— <div class='inline'>
|
|
465
|
-
|
|
466
|
-
target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
|
467
|
-
</div>
|
|
441
|
+
— <div class='inline'><p>The DNS name or IP address of a proxy server to use when connecting to the target system.
|
|
442
|
+
Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p></div>
|
|
468
443
|
|
|
469
444
|
</li>
|
|
470
445
|
|
|
@@ -475,10 +450,8 @@ target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
|
|
475
450
|
|
|
476
451
|
</span>
|
|
477
452
|
|
|
478
|
-
— <div class='inline'>
|
|
479
|
-
|
|
480
|
-
<code>Net::HTTP#new</code>'s <em>p_port</em>.</p>
|
|
481
|
-
</div>
|
|
453
|
+
— <div class='inline'><p>The proxy server port to use when connecting to the target system.
|
|
454
|
+
Maps to <code>Net::HTTP#new</code>'s <em>p_port</em>.</p></div>
|
|
482
455
|
|
|
483
456
|
</li>
|
|
484
457
|
|
|
@@ -489,10 +462,8 @@ target system. Maps to <code>Net::HTTP#new</code>'s <em>p_addr</em>.</p>
|
|
|
489
462
|
|
|
490
463
|
</span>
|
|
491
464
|
|
|
492
|
-
— <div class='inline'>
|
|
493
|
-
|
|
494
|
-
proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_user</em>.</p>
|
|
495
|
-
</div>
|
|
465
|
+
— <div class='inline'><p>The username to give if authorization is required to access the specified proxy host.
|
|
466
|
+
Maps to <code>Net::HTTP#new</code>'s <em>p_user</em>.</p></div>
|
|
496
467
|
|
|
497
468
|
</li>
|
|
498
469
|
|
|
@@ -503,10 +474,8 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_user</em>.</p>
|
|
|
503
474
|
|
|
504
475
|
</span>
|
|
505
476
|
|
|
506
|
-
— <div class='inline'>
|
|
507
|
-
|
|
508
|
-
proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
509
|
-
</div>
|
|
477
|
+
— <div class='inline'><p>The password to give if authorization is required to access the specified proxy host.
|
|
478
|
+
Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p></div>
|
|
510
479
|
|
|
511
480
|
</li>
|
|
512
481
|
|
|
@@ -519,7 +488,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
|
519
488
|
<li>
|
|
520
489
|
|
|
521
490
|
|
|
522
|
-
<span class='type'>(<tt><span class='object_link'><a href="ArgumentError.html" title="
|
|
491
|
+
<span class='type'>(<tt><span class='object_link'><a href="ArgumentError.html" title="CrAPI::ArgumentError (class)">CrAPI::ArgumentError</a></span></tt>)</span>
|
|
523
492
|
|
|
524
493
|
|
|
525
494
|
|
|
@@ -560,7 +529,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
|
560
529
|
<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
530
|
<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
531
|
<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="../
|
|
532
|
+
<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
533
|
<span class='kw'>end</span>
|
|
565
534
|
|
|
566
535
|
<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 +542,7 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
|
573
542
|
<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
543
|
<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
544
|
|
|
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="
|
|
545
|
+
<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
546
|
<span class='kw'>end</span></pre>
|
|
578
547
|
</td>
|
|
579
548
|
</tr>
|
|
@@ -598,11 +567,9 @@ proxy host. Maps to <code>Net::HTTP#new</code>'s <em>p_pass</em>.</p>
|
|
|
598
567
|
|
|
599
568
|
</h3><div class="docstring">
|
|
600
569
|
<div class="discussion">
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
<em>headers</em> still override any conflicting default header.</p>
|
|
605
|
-
|
|
570
|
+
<p>A Hash containing headers to send with every request (unless overriden elsewhere). Headers
|
|
571
|
+
set by the user via the CRUD methods' <em>headers</em> still override any conflicting default
|
|
572
|
+
header.</p>
|
|
606
573
|
|
|
607
574
|
</div>
|
|
608
575
|
</div>
|
|
@@ -648,9 +615,7 @@ elsewhere). Headers set by the user via the CRUD methods'
|
|
|
648
615
|
|
|
649
616
|
</h3><div class="docstring">
|
|
650
617
|
<div class="discussion">
|
|
651
|
-
|
|
652
|
-
<p>CRUD method: DELETE</p>
|
|
653
|
-
|
|
618
|
+
<p>CRUD method: DELETE</p>
|
|
654
619
|
|
|
655
620
|
</div>
|
|
656
621
|
</div>
|
|
@@ -668,11 +633,8 @@ elsewhere). Headers set by the user via the CRUD methods'
|
|
|
668
633
|
|
|
669
634
|
|
|
670
635
|
—
|
|
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>
|
|
675
|
-
</div>
|
|
636
|
+
<div class='inline'><p>The path to the resource to DELETE. Note that this path is always interpreted as relative
|
|
637
|
+
to the client's base_uri's path, regardless of whether it begins with a "/".</p></div>
|
|
676
638
|
|
|
677
639
|
</li>
|
|
678
640
|
|
|
@@ -684,13 +646,12 @@ of whether it begins with a “/”.</p>
|
|
|
684
646
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
685
647
|
|
|
686
648
|
|
|
649
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
650
|
+
|
|
687
651
|
|
|
688
652
|
—
|
|
689
|
-
<div class='inline'>
|
|
690
|
-
|
|
691
|
-
header given here and also appearing in the client's defaults will
|
|
692
|
-
override said default value.</p>
|
|
693
|
-
</div>
|
|
653
|
+
<div class='inline'><p>Additional headers to set in addition to the client's defaults. Any header given here and
|
|
654
|
+
also appearing in the client's defaults will override said default value.</p></div>
|
|
694
655
|
|
|
695
656
|
</li>
|
|
696
657
|
|
|
@@ -702,13 +663,12 @@ override said default value.</p>
|
|
|
702
663
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
|
703
664
|
|
|
704
665
|
|
|
666
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
667
|
+
|
|
705
668
|
|
|
706
669
|
—
|
|
707
|
-
<div class='inline'>
|
|
708
|
-
|
|
709
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
|
710
|
-
before appending.</p>
|
|
711
|
-
</div>
|
|
670
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
|
671
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p></div>
|
|
712
672
|
|
|
713
673
|
</li>
|
|
714
674
|
|
|
@@ -768,9 +728,7 @@ before appending.</p>
|
|
|
768
728
|
|
|
769
729
|
</h3><div class="docstring">
|
|
770
730
|
<div class="discussion">
|
|
771
|
-
|
|
772
|
-
<p>CRUD method: GET</p>
|
|
773
|
-
|
|
731
|
+
<p>CRUD method: GET</p>
|
|
774
732
|
|
|
775
733
|
</div>
|
|
776
734
|
</div>
|
|
@@ -788,11 +746,8 @@ before appending.</p>
|
|
|
788
746
|
|
|
789
747
|
|
|
790
748
|
—
|
|
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>
|
|
795
|
-
</div>
|
|
749
|
+
<div class='inline'><p>The path to the resource to GET. Note that this path is always interpreted as relative to
|
|
750
|
+
the client's base_uri's path, regardless of whether it begins with a "/".</p></div>
|
|
796
751
|
|
|
797
752
|
</li>
|
|
798
753
|
|
|
@@ -804,13 +759,12 @@ it begins with a “/”.</p>
|
|
|
804
759
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
805
760
|
|
|
806
761
|
|
|
762
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
763
|
+
|
|
807
764
|
|
|
808
765
|
—
|
|
809
|
-
<div class='inline'>
|
|
810
|
-
|
|
811
|
-
header given here and also appearing in the client's defaults will
|
|
812
|
-
override said default value.</p>
|
|
813
|
-
</div>
|
|
766
|
+
<div class='inline'><p>Additional headers to set in addition to the client's defaults. Any header given here and
|
|
767
|
+
also appearing in the client's defaults will override said default value.</p></div>
|
|
814
768
|
|
|
815
769
|
</li>
|
|
816
770
|
|
|
@@ -822,13 +776,12 @@ override said default value.</p>
|
|
|
822
776
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
|
823
777
|
|
|
824
778
|
|
|
779
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
780
|
+
|
|
825
781
|
|
|
826
782
|
—
|
|
827
|
-
<div class='inline'>
|
|
828
|
-
|
|
829
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
|
830
|
-
before appending.</p>
|
|
831
|
-
</div>
|
|
783
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
|
784
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p></div>
|
|
832
785
|
|
|
833
786
|
</li>
|
|
834
787
|
|
|
@@ -880,7 +833,7 @@ before appending.</p>
|
|
|
880
833
|
<div class="method_details ">
|
|
881
834
|
<h3 class="signature " id="new_proxy-instance_method">
|
|
882
835
|
|
|
883
|
-
#<strong>new_proxy</strong>(segment = '/', headers: nil) ⇒ <tt><span class='object_link'><a href="Proxy.html" title="
|
|
836
|
+
#<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
837
|
|
|
885
838
|
|
|
886
839
|
|
|
@@ -888,9 +841,7 @@ before appending.</p>
|
|
|
888
841
|
|
|
889
842
|
</h3><div class="docstring">
|
|
890
843
|
<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>
|
|
893
|
-
|
|
844
|
+
<p>Returns a new <span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span> for this client.</p>
|
|
894
845
|
|
|
895
846
|
</div>
|
|
896
847
|
</div>
|
|
@@ -910,9 +861,7 @@ before appending.</p>
|
|
|
910
861
|
|
|
911
862
|
|
|
912
863
|
—
|
|
913
|
-
<div class='inline'>
|
|
914
|
-
<p>The segment to add to this client's path.</p>
|
|
915
|
-
</div>
|
|
864
|
+
<div class='inline'><p>The segment to add to this client's path.</p></div>
|
|
916
865
|
|
|
917
866
|
</li>
|
|
918
867
|
|
|
@@ -924,11 +873,11 @@ before appending.</p>
|
|
|
924
873
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
925
874
|
|
|
926
875
|
|
|
876
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
|
877
|
+
|
|
927
878
|
|
|
928
879
|
—
|
|
929
|
-
<div class='inline'>
|
|
930
|
-
<p>The default headers for the new proxy.</p>
|
|
931
|
-
</div>
|
|
880
|
+
<div class='inline'><p>The default headers for the new proxy.</p></div>
|
|
932
881
|
|
|
933
882
|
</li>
|
|
934
883
|
|
|
@@ -940,7 +889,7 @@ before appending.</p>
|
|
|
940
889
|
<li>
|
|
941
890
|
|
|
942
891
|
|
|
943
|
-
<span class='type'>(<tt><span class='object_link'><a href="Proxy.html" title="
|
|
892
|
+
<span class='type'>(<tt><span class='object_link'><a href="Proxy.html" title="CrAPI::Proxy (class)">CrAPI::Proxy</a></span></tt>)</span>
|
|
944
893
|
|
|
945
894
|
|
|
946
895
|
|
|
@@ -962,7 +911,7 @@ before appending.</p>
|
|
|
962
911
|
<pre class="code"><span class="info file"># File 'lib/crapi/client.rb', line 89</span>
|
|
963
912
|
|
|
964
913
|
<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="
|
|
914
|
+
<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
915
|
<span class='kw'>end</span></pre>
|
|
967
916
|
</td>
|
|
968
917
|
</tr>
|
|
@@ -980,9 +929,7 @@ before appending.</p>
|
|
|
980
929
|
|
|
981
930
|
</h3><div class="docstring">
|
|
982
931
|
<div class="discussion">
|
|
983
|
-
|
|
984
|
-
<p>CRUD method: PATCH</p>
|
|
985
|
-
|
|
932
|
+
<p>CRUD method: PATCH</p>
|
|
986
933
|
|
|
987
934
|
</div>
|
|
988
935
|
</div>
|
|
@@ -1000,11 +947,8 @@ before appending.</p>
|
|
|
1000
947
|
|
|
1001
948
|
|
|
1002
949
|
—
|
|
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>
|
|
1007
|
-
</div>
|
|
950
|
+
<div class='inline'><p>The path to the resource to PATCH. Note that this path is always interpreted as relative to
|
|
951
|
+
the client's base_uri's path, regardless of whether it begins with a "/".</p></div>
|
|
1008
952
|
|
|
1009
953
|
</li>
|
|
1010
954
|
|
|
@@ -1016,13 +960,12 @@ of whether it begins with a “/”.</p>
|
|
|
1016
960
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1017
961
|
|
|
1018
962
|
|
|
963
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
964
|
+
|
|
1019
965
|
|
|
1020
966
|
—
|
|
1021
|
-
<div class='inline'>
|
|
1022
|
-
|
|
1023
|
-
header given here and also appearing in the client's defaults will
|
|
1024
|
-
override said default value.</p>
|
|
1025
|
-
</div>
|
|
967
|
+
<div class='inline'><p>Additional headers to set in addition to the client's defaults. Any header given here and
|
|
968
|
+
also appearing in the client's defaults will override said default value.</p></div>
|
|
1026
969
|
|
|
1027
970
|
</li>
|
|
1028
971
|
|
|
@@ -1034,13 +977,12 @@ override said default value.</p>
|
|
|
1034
977
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
|
1035
978
|
|
|
1036
979
|
|
|
980
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
981
|
+
|
|
1037
982
|
|
|
1038
983
|
—
|
|
1039
|
-
<div class='inline'>
|
|
1040
|
-
|
|
1041
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
|
1042
|
-
before appending.</p>
|
|
1043
|
-
</div>
|
|
984
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
|
985
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p></div>
|
|
1044
986
|
|
|
1045
987
|
</li>
|
|
1046
988
|
|
|
@@ -1052,12 +994,12 @@ before appending.</p>
|
|
|
1052
994
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
|
1053
995
|
|
|
1054
996
|
|
|
997
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
998
|
+
|
|
1055
999
|
|
|
1056
1000
|
—
|
|
1057
|
-
<div class='inline'>
|
|
1058
|
-
|
|
1059
|
-
per the request's “Content-Type” header.</p>
|
|
1060
|
-
</div>
|
|
1001
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
|
1002
|
+
request's "Content-Type" header.</p></div>
|
|
1061
1003
|
|
|
1062
1004
|
</li>
|
|
1063
1005
|
|
|
@@ -1097,7 +1039,7 @@ per the request's “Content-Type” header.</p>
|
|
|
1097
1039
|
|
|
1098
1040
|
<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
1041
|
<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'
|
|
1042
|
+
<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
1043
|
|
|
1102
1044
|
<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
1045
|
<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,9 +1061,7 @@ per the request's “Content-Type” header.</p>
|
|
|
1119
1061
|
|
|
1120
1062
|
</h3><div class="docstring">
|
|
1121
1063
|
<div class="discussion">
|
|
1122
|
-
|
|
1123
|
-
<p>CRUD method: POST</p>
|
|
1124
|
-
|
|
1064
|
+
<p>CRUD method: POST</p>
|
|
1125
1065
|
|
|
1126
1066
|
</div>
|
|
1127
1067
|
</div>
|
|
@@ -1139,11 +1079,8 @@ per the request's “Content-Type” header.</p>
|
|
|
1139
1079
|
|
|
1140
1080
|
|
|
1141
1081
|
—
|
|
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>
|
|
1146
|
-
</div>
|
|
1082
|
+
<div class='inline'><p>The path to the resource to POST. Note that this path is always interpreted as relative to
|
|
1083
|
+
the client's base_uri's path, regardless of whether it begins with a "/".</p></div>
|
|
1147
1084
|
|
|
1148
1085
|
</li>
|
|
1149
1086
|
|
|
@@ -1155,13 +1092,12 @@ it begins with a “/”.</p>
|
|
|
1155
1092
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1156
1093
|
|
|
1157
1094
|
|
|
1095
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1096
|
+
|
|
1158
1097
|
|
|
1159
1098
|
—
|
|
1160
|
-
<div class='inline'>
|
|
1161
|
-
|
|
1162
|
-
header given here and also appearing in the client's defaults will
|
|
1163
|
-
override said default value.</p>
|
|
1164
|
-
</div>
|
|
1099
|
+
<div class='inline'><p>Additional headers to set in addition to the client's defaults. Any header given here and
|
|
1100
|
+
also appearing in the client's defaults will override said default value.</p></div>
|
|
1165
1101
|
|
|
1166
1102
|
</li>
|
|
1167
1103
|
|
|
@@ -1173,13 +1109,12 @@ override said default value.</p>
|
|
|
1173
1109
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
|
1174
1110
|
|
|
1175
1111
|
|
|
1112
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1113
|
+
|
|
1176
1114
|
|
|
1177
1115
|
—
|
|
1178
|
-
<div class='inline'>
|
|
1179
|
-
|
|
1180
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
|
1181
|
-
before appending.</p>
|
|
1182
|
-
</div>
|
|
1116
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
|
1117
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p></div>
|
|
1183
1118
|
|
|
1184
1119
|
</li>
|
|
1185
1120
|
|
|
@@ -1191,12 +1126,12 @@ before appending.</p>
|
|
|
1191
1126
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
|
1192
1127
|
|
|
1193
1128
|
|
|
1129
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1130
|
+
|
|
1194
1131
|
|
|
1195
1132
|
—
|
|
1196
|
-
<div class='inline'>
|
|
1197
|
-
|
|
1198
|
-
per the request's “Content-Type” header.</p>
|
|
1199
|
-
</div>
|
|
1133
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
|
1134
|
+
request's "Content-Type" header.</p></div>
|
|
1200
1135
|
|
|
1201
1136
|
</li>
|
|
1202
1137
|
|
|
@@ -1236,7 +1171,7 @@ per the request's “Content-Type” header.</p>
|
|
|
1236
1171
|
|
|
1237
1172
|
<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
1173
|
<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'
|
|
1174
|
+
<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
1175
|
|
|
1241
1176
|
<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
1177
|
<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,9 +1193,7 @@ per the request's “Content-Type” header.</p>
|
|
|
1258
1193
|
|
|
1259
1194
|
</h3><div class="docstring">
|
|
1260
1195
|
<div class="discussion">
|
|
1261
|
-
|
|
1262
|
-
<p>CRUD method: PUT</p>
|
|
1263
|
-
|
|
1196
|
+
<p>CRUD method: PUT</p>
|
|
1264
1197
|
|
|
1265
1198
|
</div>
|
|
1266
1199
|
</div>
|
|
@@ -1278,11 +1211,8 @@ per the request's “Content-Type” header.</p>
|
|
|
1278
1211
|
|
|
1279
1212
|
|
|
1280
1213
|
—
|
|
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>
|
|
1285
|
-
</div>
|
|
1214
|
+
<div class='inline'><p>The path to the resource to PATCH. Note that this path is always interpreted as relative to
|
|
1215
|
+
the client's base_uri's path, regardless of whether it begins with a "/".</p></div>
|
|
1286
1216
|
|
|
1287
1217
|
</li>
|
|
1288
1218
|
|
|
@@ -1294,13 +1224,12 @@ of whether it begins with a “/”.</p>
|
|
|
1294
1224
|
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1295
1225
|
|
|
1296
1226
|
|
|
1227
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1228
|
+
|
|
1297
1229
|
|
|
1298
1230
|
—
|
|
1299
|
-
<div class='inline'>
|
|
1300
|
-
|
|
1301
|
-
header given here and also appearing in the client's defaults will
|
|
1302
|
-
override said default value.</p>
|
|
1303
|
-
</div>
|
|
1231
|
+
<div class='inline'><p>Additional headers to set in addition to the client's defaults. Any header given here and
|
|
1232
|
+
also appearing in the client's defaults will override said default value.</p></div>
|
|
1304
1233
|
|
|
1305
1234
|
</li>
|
|
1306
1235
|
|
|
@@ -1312,13 +1241,12 @@ override said default value.</p>
|
|
|
1312
1241
|
<span class='type'>(<tt>Hash</tt>, <tt>Array</tt>, <tt>String</tt>)</span>
|
|
1313
1242
|
|
|
1314
1243
|
|
|
1244
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1245
|
+
|
|
1315
1246
|
|
|
1316
1247
|
—
|
|
1317
|
-
<div class='inline'>
|
|
1318
|
-
|
|
1319
|
-
appended as-is; Hashes and Arrays are serialized as URI-encoded form data
|
|
1320
|
-
before appending.</p>
|
|
1321
|
-
</div>
|
|
1248
|
+
<div class='inline'><p>Query string values, if any, to append to the given path. Strings are appended as-is;
|
|
1249
|
+
Hashes and Arrays are serialized as URI-encoded form data before appending.</p></div>
|
|
1322
1250
|
|
|
1323
1251
|
</li>
|
|
1324
1252
|
|
|
@@ -1330,12 +1258,12 @@ before appending.</p>
|
|
|
1330
1258
|
<span class='type'>(<tt>Hash</tt>, <tt>String</tt>)</span>
|
|
1331
1259
|
|
|
1332
1260
|
|
|
1261
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
|
1262
|
+
|
|
1333
1263
|
|
|
1334
1264
|
—
|
|
1335
|
-
<div class='inline'>
|
|
1336
|
-
|
|
1337
|
-
per the request's “Content-Type” header.</p>
|
|
1338
|
-
</div>
|
|
1265
|
+
<div class='inline'><p>The payload to send, if any. Strings are used as-is; Hashes are serialized per the
|
|
1266
|
+
request's "Content-Type" header.</p></div>
|
|
1339
1267
|
|
|
1340
1268
|
</li>
|
|
1341
1269
|
|
|
@@ -1375,7 +1303,7 @@ per the request's “Content-Type” header.</p>
|
|
|
1375
1303
|
|
|
1376
1304
|
<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
1305
|
<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'
|
|
1306
|
+
<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
1307
|
|
|
1380
1308
|
<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
1309
|
<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,11 +1319,11 @@ per the request's “Content-Type” header.</p>
|
|
|
1391
1319
|
</div>
|
|
1392
1320
|
|
|
1393
1321
|
<div id="footer">
|
|
1394
|
-
Generated on
|
|
1395
|
-
<a href="
|
|
1396
|
-
0.9.
|
|
1322
|
+
Generated on Sun Jul 5 14:46:38 2026 by
|
|
1323
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1324
|
+
0.9.44 (ruby-3.4.8).
|
|
1397
1325
|
</div>
|
|
1398
1326
|
|
|
1399
1327
|
</div>
|
|
1400
1328
|
</body>
|
|
1401
|
-
</html>
|
|
1329
|
+
</html>
|