From c007ad426e578859fcf26067b1007b97789efd15 Mon Sep 17 00:00:00 2001 From: Tom Scavo Date: Mon, 17 Oct 2016 13:34:01 -0400 Subject: [PATCH] Add example to overview section --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bcecd3..163fdf9 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ $ export LIB_DIR=$HOME/lib $ ./install.sh $BIN_DIR $LIB_DIR ``` -A target directory will be created if one doesn't already exist. The following files will be installed: +A given target directory will be created if one doesn't already exist. In any case, the following files will be installed: ```Shell $ ls -1 $BIN_DIR @@ -38,7 +38,28 @@ md_tools.sh ## Overview -Bash script ``cget.sh`` retrieves and caches HTTP resources on disk. A previously cached resource is retrieved via HTTP Conditional GET [RFC 7232]. If the web server responds with HTTP 200 OK, the resource is cached and written to stdout. If the web server responds with 304 Not Modified, the cached resource is written to stdout instead. +Bash script ``cget.sh`` retrieves and caches HTTP resources on disk. A previously cached resource is retrieved via HTTP Conditional GET [RFC 7232]. If the web server responds with HTTP 200 OK, the resource is cached and written to stdout. If the web server responds with 304 Not Modified, the cached resource is output instead. + +```Shell +$ MD_LOCATION=http://md.incommon.org/InCommon/InCommon-metadata.xml +$ CACHE_DIR=/tmp/http_cache +$ $BIN_DIR/cget.sh $MD_LOCATION > /dev/null +$ echo $? +0 +$ ls -1 $CACHE_DIR +885d2eedcad7d0355da5bb9e648833ec_content +885d2eedcad7d0355da5bb9e648833ec_headers +$ cat /tmp/http_cache/885d2eedcad7d0355da5bb9e648833ec_headers +HTTP/1.1 200 OK +Date: Mon, 17 Oct 2016 17:26:58 GMT +Server: Apache +Last-Modified: Fri, 14 Oct 2016 19:07:55 GMT +ETag: "190004-24ddf06-53ed7f18d18c0" +Accept-Ranges: bytes +Content-Length: 38657798 +Connection: close +Content-Type: application/samlmetadata+xml +``` See the inline help file for details: