mirror of
https://github.com/curl/curl.git
synced 2026-07-23 18:37:17 +03:00
curl: two new command line options for etags
--etag-compare and --etag-save Suggested-by: Paul Hoffman Fixes #4277 Closes #4543
This commit is contained in:
parent
1ff63fa69b
commit
18e5cb77e9
15 changed files with 390 additions and 3 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
17
docs/cmdline-opts/etag-compare.d
Normal file
17
docs/cmdline-opts/etag-compare.d
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Long: etag-compare
|
||||
Arg: <file>
|
||||
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.
|
||||
15
docs/cmdline-opts/etag-save.d
Normal file
15
docs/cmdline-opts/etag-save.d
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Long: etag-save
|
||||
Arg: <file>
|
||||
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 <file>.
|
||||
|
||||
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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue