how would I send an etag over cURL? also can cURL save the etag like it does with COOKIEJAR?
from the headers i see this
my GET request
GET /Vpreviews/p/8b329b598fcdad4fd33432e78128da48f7219882.fll? e=1332973900&ri=4500&rs=75&h=bca0ce28998e637f27cf1d5c7042e7a0 HTTP/1.1 Host: veoh-139.vo.llnwd.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0.1) Gecko/20100101 Firefox/8.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 DNT: 1 Connection: keep-alive
server response
HTTP/1.1 200 OK Server: Veoh-1.5 (lighttpd-1.4.18) Content-Type: video/x-flv Accept-Ranges: bytes Etag: "8b329b598fcdad4fd33432e78128da48f72198829640882" User-Header: X-llnw-rate-limit: ri=4500, rs=98 Age: 162476 Date: Wed, 28 Mar 2012 22:06:41 GMT Last-Modified: Sun, 01 Jan 2012 13:29:44 GMT Expires: Mon, 27 Mar 2017 06:02:35 GMT Content-Length: 9640882 Connection: keep-alive
December 6, 2019 Daniel Stenberg. The ETag HTTP response header is an identifier for a specific version of a resource. It lets caches be more efficient and save bandwidth, as a web server does not need to resend a full response if the content has not changed.
An entity tag (ETag) is an HTTP header used for Web cache validation and conditional requests from browsers for resources. Etags use persistent identification elements (PIE) that have been tagged to the user's browser.
To make a GET request using Curl, run the curl command followed by the target URL. Curl automatically selects the HTTP GET request method unless you use the -X, --request, or -d command-line option.
Take a look at this Railscast. In the show notes, you can see examples of using curl to grab a page with cookies and ETags.
Basically, you pass it in with a 'If-None-Match' header:
curl -I http://localhost:3000/books/1 --header 'If-None-Match: "0f46357eafa5c719e8e3bf277a993e07"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With