File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
resources/views/vendor/scribe/partials/example-requests Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ @php
2
+ /** @var Knuckles\Camel\Output\OutputEndpointData $endpoint */
3
+ @endphp
4
+
5
+ ```ruby
6
+
7
+ require 'rest-client'
8
+
9
+ @if (! empty ($endpoint -> cleanBodyParameters ) )
10
+ body = {!! json_encode ($endpoint -> cleanBodyParameters , JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) ! !}
11
+ @endif
12
+ @if (! empty ($endpoint -> headers ) )
13
+ headers = {
14
+ @foreach ($endpoint -> headers as $header => $value )
15
+ "{{ $header } } ": "{{ $value } } ",
16
+ @endforeach
17
+ }
18
+ @endif
19
+
20
+ response = RestClient.{{ strtolower ($endpoint -> httpMethods [0 ])} } (
21
+ '{{ $baseUrl } } /{{ $endpoint -> boundUri } } '@if (! empty ($endpoint -> cleanBodyParameters ) ),
22
+ body @endif
23
+ @if (! empty ($endpoint -> headers ) ),
24
+ headers
25
+ @endif
26
+ )
27
+
28
+ p response.body
29
+
30
+ ```
You can’t perform that action at this time.
0 commit comments