From b84bc8b70d42a6b5df6cde0a3c524a48ef36321f Mon Sep 17 00:00:00 2001 From: Tom Scavo <trscavo@internet2.edu> Date: Sun, 7 May 2017 16:39:25 -0400 Subject: [PATCH] Refresh documented sample code --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 40e850c..eb7a1be 100644 --- a/README.md +++ b/README.md @@ -77,10 +77,10 @@ Now GET the first resource: ```Shell $ $BIN_DIR/cget.sh $url1 > /dev/null -2017-05-02T15:29:35Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-05-02T15:29:41Z INFO conditional_get received response code: 200 -2017-05-02T15:29:41Z INFO conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content -2017-05-02T15:29:41Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-05-07T20:33:25Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-07T20:33:30Z INFO conditional_get received response code: 200 +2017-05-07T20:33:30Z INFO conditional_get writing cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content +2017-05-07T20:33:30Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content $ echo $? 0 $ ls -1 $CACHE_DIR @@ -88,12 +88,12 @@ $ ls -1 $CACHE_DIR 1e6b844a49d1850b82feded72cf83ed7_headers $ cat $CACHE_DIR/1e6b844a49d1850b82feded72cf83ed7_headers HTTP/1.1 200 OK -Date: Tue, 02 May 2017 15:29:34 GMT +Date: Sun, 07 May 2017 20:30:37 GMT Server: Apache -Last-Modified: Mon, 01 May 2017 19:02:13 GMT -ETag: "29bcdb4-54e7b0fa340c5" +Last-Modified: Fri, 05 May 2017 19:21:06 GMT +ETag: "29d99bc-54ecbca81c111" Accept-Ranges: bytes -Content-Length: 43765172 +Content-Length: 43882940 Content-Type: application/samlmetadata+xml ``` @@ -101,9 +101,9 @@ Assuming the resource doesn't change on the server, subsequent requests will ret ```Shell $ $BIN_DIR/cget.sh -C $url1 | wc -c -2017-05-02T15:30:39Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-05-02T15:30:39Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content - 43765172 +2017-05-07T20:35:30Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-07T20:35:30Z INFO conditional_get reading cached content file: /tmp/http_cache/1e6b844a49d1850b82feded72cf83ed7_content + 43882940 ``` Of course the `-C` option will fail if the resource is not cached: @@ -111,8 +111,8 @@ Of course the `-C` option will fail if the resource is not cached: ```Shell # illustrate "quiet failure mode" $ $BIN_DIR/cget.sh -C $url2 -2017-05-02T15:31:07Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml -2017-05-02T15:31:07Z ERROR conditional_get: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-07T20:36:07Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-07T20:36:07Z WARN conditional_get: resource not cached: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml $ echo $? 1 ``` @@ -122,9 +122,9 @@ OTOH, the `-F` option forces the return of a fresh resource from the server. If ```Shell # further illustrate "quiet failure mode" $ $BIN_DIR/cget.sh -F $url1 -2017-05-02T15:31:42Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml -2017-05-02T15:31:48Z INFO conditional_get received response code: 304 -2017-05-02T15:31:48Z ERROR conditional_get: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-07T20:36:58Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml +2017-05-07T20:36:58Z INFO conditional_get received response code: 304 +2017-05-07T20:36:58Z WARN conditional_get: resource not modified: http://md.incommon.org/InCommon/InCommon-metadata-preview.xml $ echo $? 1 ``` @@ -133,10 +133,10 @@ The `-F` option will work on the other URL, however: ```Shell $ $BIN_DIR/cget.sh -F $url2 > /dev/null -2017-05-02T15:32:27Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml -2017-05-02T15:32:32Z INFO conditional_get received response code: 200 -2017-05-02T15:32:32Z INFO conditional_get writing cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content -2017-05-02T15:32:32Z INFO conditional_get reading cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content +2017-05-07T20:37:50Z INFO cget.sh requesting resource: http://md.incommon.org/InCommon/InCommon-metadata-fallback.xml +2017-05-07T20:37:54Z INFO conditional_get received response code: 200 +2017-05-07T20:37:54Z INFO conditional_get writing cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content +2017-05-07T20:37:54Z INFO conditional_get reading cached content file: /tmp/http_cache/1727196e5b7593f3b7528c539e7169d2_content $ echo $? 0 $ ls -1 $CACHE_DIR @@ -146,12 +146,12 @@ $ ls -1 $CACHE_DIR 1e6b844a49d1850b82feded72cf83ed7_headers $ cat $CACHE_DIR/1727196e5b7593f3b7528c539e7169d2_headers HTTP/1.1 200 OK -Date: Tue, 02 May 2017 15:32:26 GMT +Date: Sun, 07 May 2017 20:35:01 GMT Server: Apache -Last-Modified: Mon, 01 May 2017 19:02:13 GMT -ETag: "29bcdb4-54e7b0fa246c3" +Last-Modified: Fri, 05 May 2017 19:21:06 GMT +ETag: "29d99bc-54ecbca8059e8" Accept-Ranges: bytes -Content-Length: 43765172 +Content-Length: 43882940 Content-Type: application/samlmetadata+xml ```