From 18e5cb77e986911063da8ab6bf254d632b2de6ea Mon Sep 17 00:00:00 2001 From: Maros Priputen Date: Wed, 30 Oct 2019 09:43:14 +0100 Subject: curl: two new command line options for etags --etag-compare and --etag-save Suggested-by: Paul Hoffman Fixes #4277 Closes #4543 --- docs/cmdline-opts/Makefile.inc | 2 ++ docs/cmdline-opts/etag-compare.d | 17 +++++++++++++++++ docs/cmdline-opts/etag-save.d | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 docs/cmdline-opts/etag-compare.d create mode 100644 docs/cmdline-opts/etag-save.d (limited to 'docs/cmdline-opts') diff --git a/docs/cmdline-opts/Makefile.inc b/docs/cmdline-opts/Makefile.inc index fd29dfb23..829551ff6 100644 --- a/docs/cmdline-opts/Makefile.inc +++ b/docs/cmdline-opts/Makefile.inc @@ -38,6 +38,8 @@ DPAGES = \ dump-header.d \ egd-file.d \ engine.d \ + etag-save.d \ + etag-compare.d \ expect100-timeout.d \ fail-early.d \ fail.d \ diff --git a/docs/cmdline-opts/etag-compare.d b/docs/cmdline-opts/etag-compare.d new file mode 100644 index 000000000..1c1364f43 --- /dev/null +++ b/docs/cmdline-opts/etag-compare.d @@ -0,0 +1,17 @@ +Long: etag-compare +Arg: +Help: Pass an ETag from a file as a custom header +Protocols: HTTP +--- +This option makes a conditional HTTP request for the specific +ETag read from the given file by sending a custom If-None-Match +header using the extracted ETag. + +For correct results, make sure that specified file contains only a single +line with a desired ETag. An empty file is parsed as an empty ETag. + +Use the option --etag-save to first save the ETag from a response, and +then use this option to compare using the saved ETag in a subsequent request. + +\fCOMPARISON\fP: There are 2 types of comparison or ETags, Weak and Strong. +This option expects, and uses a strong comparison. diff --git a/docs/cmdline-opts/etag-save.d b/docs/cmdline-opts/etag-save.d new file mode 100644 index 000000000..fa0694d14 --- /dev/null +++ b/docs/cmdline-opts/etag-save.d @@ -0,0 +1,15 @@ +Long: etag-save +Arg: +Help: Parse ETag from a request and save it to a file +Protocols: HTTP +--- +This option saves an HTTP ETag to the specified file. Etag is +usually part of headers returned by a request. When server sends an +ETag, it must be enveloped by a double quote. This option extracts the +ETag without the double quotes and saves it into the . + +A server can send a week ETag which is prefixed by "W/". This identifier +is not considered, and only relevant ETag between quotation marks is parsed. + +It an ETag wasn't send by the server or it cannot be parsed, and empty +file is created. -- cgit v1.2.3