UNPKG

617 BJavaScriptView Raw
1'use strict';
2const pkg = require('../package.json');
3const create = require('./create');
4
5const defaults = {
6 options: {
7 retry: {
8 retries: 2,
9 methods: [
10 'GET',
11 'PUT',
12 'HEAD',
13 'DELETE',
14 'OPTIONS',
15 'TRACE'
16 ],
17 statusCodes: [
18 408,
19 413,
20 429,
21 500,
22 502,
23 503,
24 504
25 ]
26 },
27 cache: false,
28 decompress: true,
29 useElectronNet: false,
30 throwHttpErrors: true,
31 headers: {
32 'user-agent': `${pkg.name}/${pkg.version} (https://github.com/sindresorhus/got)`
33 },
34 hooks: {
35 beforeRequest: []
36 }
37 }
38};
39
40const got = create(defaults);
41
42module.exports = got;