From 75209db8a02fabcebb2822a8a9e700736dc51b79 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 20 Mar 2017 19:11:31 +0800 Subject: [PATCH] Mention 304 behaviour in readme --- readme.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index bfab067..ee53c61 100644 --- a/readme.md +++ b/readme.md @@ -301,7 +301,9 @@ got('unix:/var/run/docker.sock:/containers/json'); ``` -## Tip +## Tips + +### User Agent It's a good idea to set the `'user-agent'` header so the provider can more easily see how their resource is used. By default, it's the URL to this repo. @@ -316,6 +318,10 @@ got('todomvc.com', { }); ``` +### 304 Responses + +Bear in mind, if you send an `if-modified-since` header and receive a `304 Not Modified` response, the body will be empty. It's your responsibility to cache and retrieve the body contents. + ## Related