Skip to content

Commit

Permalink
Consistency b/n paragraph text and code fence for curl option flag
Browse files Browse the repository at this point in the history
The code fence uses the `--data-binary @filename` flag, but the subsequent paragraph references the same operation using the `-d` shorthand. Changed for consistency, and also to reduce liklihood of confusing readers who aren't familar with the UNIX long-hand and short-hand conventions (eg; `--foo-bar` vs `-f`).
  • Loading branch information
Danny Eck authored and Danny Eck committed Jan 7, 2015
1 parent 440732f commit 92966ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editions/1/en/api.html
Expand Up @@ -371,7 +371,7 @@ <h5 id="attachments">Attachments</h5>
&gt; curl -vX PUT http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/ artwork.jpg?rev=2-2739352689 --data-binary @artwork.jpg -H "Content-Type: image/jpg"
</pre>

<p>The <code>-d@</code> option tells <code>curl</code> to read a file’s contents into the HTTP request body. We’re using the <code>-H</code> option to tell CouchDB that we’re uploading a JPEG file. CouchDB will keep this information around and will send the appropriate header when requesting this attachment; in case of an image like this, a browser will render the image instead of offering you the data for download. This will come in handy later. Note that you need to provide the current revision number of the document you’re attaching the artwork to, just as if you would update the document. Because, after all, attaching some data is changing the document.
<p>The <code>--data-binary @filename</code> option tells <code>curl</code> to read a file’s contents into the HTTP request body. We’re using the <code>-H</code> option to tell CouchDB that we’re uploading a JPEG file. CouchDB will keep this information around and will send the appropriate header when requesting this attachment; in case of an image like this, a browser will render the image instead of offering you the data for download. This will come in handy later. Note that you need to provide the current revision number of the document you’re attaching the artwork to, just as if you would update the document. Because, after all, attaching some data is changing the document.

<p>You should now see your artwork image if you point your browser to <code>http://127.0.0.1:5984/albums/6e1295ed6c29495e54cc05947f18c8af/artwork.jpg</code>.

Expand Down

0 comments on commit 92966ac

Please sign in to comment.