mirror of
https://github.com/caddyserver/website.git
synced 2025-05-07 04:07:13 -04:00
docs: Remove -X POST
Curl automatically uses POST for -d and --data-binary. I intentionally left it in to be explicit to learners, but maybe best practices are better.
This commit is contained in:
parent
0b5062a6ad
commit
03f02e7dfc
6 changed files with 4 additions and 14 deletions
|
@ -64,13 +64,13 @@ If the new config is the same as the current one, no reload will occur. To force
|
|||
|
||||
Set a new active configuration:
|
||||
|
||||
<pre><code class="cmd bash">curl -X POST "http://localhost:2019/load" \
|
||||
<pre><code class="cmd bash">curl "http://localhost:2019/load" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @caddy.json</code></pre>
|
||||
|
||||
Note: curl's `-d` flag removes newlines, so if your config format is sensitive to line breaks (e.g. the Caddyfile), use `--data-binary` instead:
|
||||
|
||||
<pre><code class="cmd bash">curl -X POST "http://localhost:2019/load" \
|
||||
<pre><code class="cmd bash">curl "http://localhost:2019/load" \
|
||||
-H "Content-Type: text/caddyfile" \
|
||||
--data-binary @Caddyfile</code></pre>
|
||||
|
||||
|
@ -152,14 +152,14 @@ baseSlice = append(baseSlice, newElems...)
|
|||
|
||||
Add a listener address:
|
||||
|
||||
<pre><code class="cmd bash">curl -X POST \
|
||||
<pre><code class="cmd bash">curl \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '":8080"' \
|
||||
"http://localhost:2019/config/apps/http/servers/myserver/listen"</code></pre>
|
||||
|
||||
Add multiple listener addresses:
|
||||
|
||||
<pre><code class="cmd bash">curl -X POST \
|
||||
<pre><code class="cmd bash">curl \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '[":8080", ":5133"]' \
|
||||
"http://localhost:2019/config/apps/http/servers/myserver/listen/..."</code></pre>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue