From ef989fa555eb7d5e591ba78663fa4fcbe1713b38 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 16 Mar 2015 15:14:31 +0700 Subject: [PATCH] readme - add note about setting 'user-agent' header --- readme.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index f238289..082d09a 100644 --- a/readme.md +++ b/readme.md @@ -123,7 +123,22 @@ got('todomvc.com', { host: 'localhost' } }) -}, function (err, data, res) {}); +}, function () {}); +``` + + +## Tip + +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. + +```js +var got = require('got'); + +got('todomvc.com', { + headers: { + 'user-agent': 'https://github.com/your-username/repo-name' + } +}, function () {}); ```