<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recipes on Restish</title><link>https://rest.sh/docs/recipes/</link><description>Recent content in Recipes on Restish</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://rest.sh/docs/recipes/index.xml" rel="self" type="application/rss+xml"/><item><title>Post JSON From a File</title><link>https://rest.sh/docs/recipes/post-json-from-a-file/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/post-json-from-a-file/</guid><description>&lt;p&gt;Use a file when the request body is too large or too important to type as
shorthand on the command line. Restish reads stdin, decodes the structured
document, and sends it as the request body.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish post api.rest.sh/post &amp;lt; payload.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Example &lt;code&gt;payload.json&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;Alice&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nt"&gt;&amp;#34;enabled&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;/post&lt;/code&gt; fixture echoes the parsed body so you can verify what was sent.&lt;/p&gt;
&lt;p&gt;Variant with explicit content type:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish post -c json api.rest.sh/post &amp;lt; payload.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The explicit &lt;code&gt;-c json&lt;/code&gt; form is useful when stdin comes from a source without a
clear extension or when a script should make the request encoding obvious. For
small bodies, &lt;a href="https://rest.sh/docs/reference/shorthand/"&gt;shorthand&lt;/a&gt; is usually faster.&lt;/p&gt;</description></item><item><title>Upload a File With Multipart</title><link>https://rest.sh/docs/recipes/upload-a-file-with-multipart/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/upload-a-file-with-multipart/</guid><description>&lt;p&gt;Multipart requests are used for uploads that combine normal form fields with
file parts. &lt;code&gt;-c multipart&lt;/code&gt; chooses the request encoding, and &lt;code&gt;@upload.txt&lt;/code&gt;
tells Restish to send the file contents rather than the literal string.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;hello from docs\n&amp;#39;&lt;/span&gt; &amp;gt; upload.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish post -c multipart api.rest.sh/uploads &lt;span class="s1"&gt;&amp;#39;description: docs, file: @upload.txt&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The response echoes multipart fields. If a client sends real file parts,
&lt;code&gt;/uploads&lt;/code&gt; also reports file metadata. Missing file paths fail before the
request is sent. Use &lt;code&gt;@@value&lt;/code&gt; when a text field should start with a literal
&lt;code&gt;@&lt;/code&gt;. For plain URL-encoded forms, use &lt;code&gt;-c form&lt;/code&gt; instead; both encodings are
explained in &lt;a href="https://rest.sh/docs/guides/input/"&gt;Input and Shorthand&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Create, Patch, and Delete an Item Safely</title><link>https://rest.sh/docs/recipes/create-patch-and-delete-an-item-safely/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/create-patch-and-delete-an-item-safely/</guid><description>&lt;p&gt;This recipe practices a full create-update-delete loop against the public
example API. Because &lt;code&gt;/items&lt;/code&gt; is shared and resettable, use a unique ID so your
example does not collide with someone else&amp;rsquo;s state:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;ITEM_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;docs-&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;date +%s&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish post api.rest.sh/items &lt;span class="s2"&gt;&amp;#34;id: &lt;/span&gt;&lt;span class="nv"&gt;$ITEM_ID&lt;/span&gt;&lt;span class="s2"&gt;, name: Demo, enabled: true, updated: 2026-04-27T00:00:00Z&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish patch &lt;span class="s2"&gt;&amp;#34;api.rest.sh/items/&lt;/span&gt;&lt;span class="nv"&gt;$ITEM_ID&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;enabled: false, tags[]: docs&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish delete &lt;span class="s2"&gt;&amp;#34;api.rest.sh/items/&lt;/span&gt;&lt;span class="nv"&gt;$ITEM_ID&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt; --rsh-ignore-status-code
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The first command creates an item from shorthand fields. The patch command sends
only the fields you want to change. The delete command uses
&lt;code&gt;--rsh-ignore-status-code&lt;/code&gt; so cleanup remains calm if the item is already gone;
see &lt;a href="https://rest.sh/docs/guides/command-behavior/"&gt;Command Behavior&lt;/a&gt; for how HTTP statuses
map to exit codes.&lt;/p&gt;</description></item><item><title>Get One Field From Every Item</title><link>https://rest.sh/docs/recipes/get-one-field-from-every-item/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/get-one-field-from-every-item/</guid><description>&lt;p&gt;This is the most common shell pattern: call a list endpoint, select one field
from each item, and print one plain value per line. It is useful for loops,
copy-paste, and quick checks.&lt;/p&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish api.rest.sh/images -f body.self -o lines&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish api.rest.sh/images -f body.self -o lines" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>Save a Response Unchanged</title><link>https://rest.sh/docs/recipes/save-a-response-unchanged/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/save-a-response-unchanged/</guid><description>&lt;p&gt;When stdout is redirected and you do not choose a filter, collection, metadata
shortcut, or output format, Restish writes the response body bytes. That matters
for binary files, structured fixtures such as CBOR, and anything another
program will parse directly. Response middleware plugins are skipped for this
raw-download path, so installed plugins cannot silently alter saved files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api.rest.sh/bytes/64 &amp;gt; sample.bin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api.rest.sh/formats/cbor &amp;gt; response.cbor
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For an image:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api.rest.sh/images/jpeg &amp;gt; dragonfly.jpg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Use &lt;code&gt;-o json&lt;/code&gt;, &lt;code&gt;-o yaml&lt;/code&gt;, or another output format when you want Restish to
transform the decoded body or apply response middleware before rendering.
Redirected byte output still uses the body that Go&amp;rsquo;s HTTP client exposes after
any HTTP content-encoding decompression; it is not a packet capture of the exact
wire transfer. The distinction is part of Restish&amp;rsquo;s
&lt;a href="https://rest.sh/docs/reference/output-defaults/"&gt;output defaults&lt;/a&gt;.
Restish&amp;rsquo;s default &lt;code&gt;Accept&lt;/code&gt; header still prefers JSON and other text-friendly
structured formats; set &lt;code&gt;Accept&lt;/code&gt; yourself when you want the server to send a
binary structured format such as CBOR.&lt;/p&gt;</description></item><item><title>Download a File With Headers Preserved</title><link>https://rest.sh/docs/recipes/download-a-file-with-headers-preserved/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/download-a-file-with-headers-preserved/</guid><description>&lt;p&gt;When you save a response to a file, stdout should contain only the body bytes.
Verbose diagnostics are written to stderr, so you can redirect them to a
separate file without corrupting the download.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish -v api.rest.sh/images/jpeg &amp;gt; dragonfly.jpg 2&amp;gt; dragonfly.headers.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The body goes to stdout and verbose metadata goes to stderr, so the saved file
stays clean. Unfiltered responses redirect as body bytes by default; see
&lt;a href="https://rest.sh/docs/reference/output-defaults/"&gt;Output Defaults&lt;/a&gt; for how redirects choose
between body bytes and formatted values.&lt;/p&gt;</description></item><item><title>Force JSON Output to a File</title><link>https://rest.sh/docs/recipes/force-json-output-to-a-file/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/force-json-output-to-a-file/</guid><description>&lt;p&gt;Redirected output saves response body bytes by default. Choose &lt;code&gt;-o json&lt;/code&gt; when a
script needs Restish to render decoded structured data as one JSON document.
&lt;code&gt;--rsh-collect&lt;/code&gt; matters when pagination is involved: it asks Restish to build
one logical document before writing the file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api.rest.sh/images --rsh-collect -o json &amp;gt; images.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The file is pretty-printed by default. Add &lt;code&gt;--rsh-print=b&lt;/code&gt; when compact JSON is
more useful:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api.rest.sh/images --rsh-collect -o json --rsh-print&lt;span class="o"&gt;=&lt;/span&gt;b &amp;gt; images.json
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Open the file with &lt;code&gt;jq&lt;/code&gt;, an editor, or another tool that expects one complete
JSON value. For line-oriented pipelines, prefer &lt;code&gt;-o ndjson&lt;/code&gt; instead; the
&lt;a href="https://rest.sh/docs/guides/output/"&gt;Output guide&lt;/a&gt; explains document versus record formats.&lt;/p&gt;</description></item><item><title>Count Items Across All Pages</title><link>https://rest.sh/docs/recipes/count-items-across-all-pages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/count-items-across-all-pages/</guid><description>&lt;p&gt;Counting is a whole-collection operation. If Restish streams paginated items as
they arrive, a filter can start earlier but it does not necessarily see the
entire logical result at once. &lt;code&gt;--rsh-collect&lt;/code&gt; tells Restish to gather the
paginated response before applying the filter.&lt;/p&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish api.rest.sh/images --rsh-collect -f &amp;#39;.body | length&amp;#39;&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish api.rest.sh/images --rsh-collect -f &amp;#39;.body | length&amp;#39;" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>Use External-Tool Auth</title><link>https://rest.sh/docs/recipes/use-external-tool-auth/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/use-external-tool-auth/</guid><description>&lt;p&gt;External-tool auth is for organizations that already have a credential helper,
request signer, SSO command, or token refresh program. Restish asks the helper
to prepare auth for the request instead of trying to own those credentials
itself.&lt;/p&gt;
&lt;p&gt;Config shape:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-jsonc" data-lang="jsonc"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;apis&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;vendor&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;base_url&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;https://api.vendor.test&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;profiles&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;default&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;auth&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;type&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;external-tool&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;params&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nt"&gt;&amp;#34;commandline&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;./scripts/sign-request&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restish approves external tools by command hash. If the helper changes, you
must approve it again.&lt;/p&gt;</description></item><item><title>Use a Custom CA</title><link>https://rest.sh/docs/recipes/use-a-custom-ca/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/use-a-custom-ca/</guid><description>&lt;p&gt;Private services often use certificates signed by an internal certificate
authority. Restish uses the normal system trust store by default; add
&lt;code&gt;--rsh-ca-cert&lt;/code&gt; when one request should also trust your organization&amp;rsquo;s CA file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish --rsh-ca-cert ./corp-ca.pem https://service.internal.test/items
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Prerequisite: &lt;code&gt;corp-ca.pem&lt;/code&gt; is the PEM-encoded CA certificate that signed the
server certificate. Replace &lt;code&gt;service.internal.test&lt;/code&gt; with the internal host you
need to reach.&lt;/p&gt;
&lt;p&gt;Inspect the chain first:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish cert --rsh-ca-cert ./corp-ca.pem https://service.internal.test
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The &lt;code&gt;cert&lt;/code&gt; command helps confirm that the server presents the certificate chain
you expect before you debug application-level behavior. For repeated internal
requests, store TLS settings in a profile as described in &lt;a href="https://rest.sh/docs/guides/tls/"&gt;TLS&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Use mTLS With a TLS Signer</title><link>https://rest.sh/docs/recipes/use-mtls-with-a-tls-signer/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/recipes/use-mtls-with-a-tls-signer/</guid><description>&lt;p&gt;mTLS proves the client identity during the TLS handshake. A TLS signer plugin is
useful when the private key lives in hardware, an OS keychain, or another system
that should not hand raw key material to Restish.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --rsh-tls-signer pkcs11 &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --rsh-tls-signer-param &lt;span class="nv"&gt;module&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/lib/opensc-pkcs11.so &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; https://mtls.internal.test/items
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Prerequisites: a configured signer plugin that can access the client
certificate and signing key material, and an API that requires mTLS. Replace
&lt;code&gt;mtls.internal.test&lt;/code&gt; and signer parameters with your environment&amp;rsquo;s values.&lt;/p&gt;</description></item></channel></rss>