Skip to content

Commit

Permalink
Update docs according to the new defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Oct 30, 2018
1 parent 232e0f3 commit 3af3616
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions advanced-creation.md
Expand Up @@ -83,23 +83,32 @@ const defaults = {
504
]
},
cache: false,
decompress: true,
useElectronNet: false,
throwHttpErrors: true,
headers: {
'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`
},
hooks: {
beforeRequest: []
}
}
beforeRequest: [],
beforeRedirect: [],
beforeRetry: [],
afterResponse: []
},
decompress: true,
throwHttpErrors: true,
followRedirect: true,
stream: false,
form: false,
json: false,
cache: false,
useElectronNet: false
},
mutableDefaults: false
};

// Same as:
const defaults = {
handler: got.defaults.handler,
options: got.defaults.options
options: got.defaults.options,
mutableDefaults: got.defaults.mutableDefaults
};

const unchangedGot = got.create(defaults);
Expand Down

0 comments on commit 3af3616

Please sign in to comment.