I am getting a collection of books from an external resource. For that i am using a call like

response = book_resource.get_books({headers:{"If-Modified-Since" => last-update-date.httpdate}})

In last-update-date i saved the value of last-modified from the header of previous response. But i am always getting the status code as 200 and instead of 304 not modified.But when i tried with etag using the following code.

 response = book_resource.get_books({headers:{"If-None-Match" => "etag"}})

The above is working fine and returning 304 not modified. Kindly help me what i am missing with modified since

没有正确的解决方案

其他提示

Which tool you use to send HTTP request? Lookup docs to see how to send customized header. For example, here is how to add headers in httprb.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top