Skip to content

Commit

Permalink
Add example to overview section
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Oct 17, 2016
1 parent 60a3317 commit c007ad4
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down

0 comments on commit c007ad4

Please sign in to comment.