File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ import got4aws from 'got4aws';
44
44
const got = got4aws ();
45
45
46
46
(async () => {
47
- const {body} = await got .get (' https://12abc34.execute-api.us-east-1.amazonaws.com/v0' , {
48
- responseType: ' json'
49
- });
47
+ const {body} = await got .get (' https://12abc34.execute-api.us-east-1.amazonaws.com/v0' );
50
48
51
49
console .log (body );
52
50
// => {status: 'ok'}
@@ -64,9 +62,7 @@ const got = got4aws({
64
62
});
65
63
66
64
(async () => {
67
- const {body} = await got .get (' https://12abc34.execute-api.us-east-1.amazonaws.com/v0' , {
68
- responseType: ' json'
69
- });
65
+ const {body} = await got .get (' https://12abc34.execute-api.us-east-1.amazonaws.com/v0' );
70
66
71
67
console .log (body );
72
68
// => {status: 'ok'}
@@ -85,9 +81,7 @@ const got = got4aws({
85
81
});
86
82
87
83
(async () => {
88
- const {body} = await got .get (' https://api.unicorn.com/v0' , {
89
- responseType: ' json'
90
- });
84
+ const {body} = await got .get (' https://api.unicorn.com/v0' );
91
85
92
86
console .log (body );
93
87
// => {status: 'ok'}
@@ -99,7 +93,7 @@ const got = got4aws({
99
93
100
94
### got4aws(options?)
101
95
102
- Returns a [ ` Got ` ] ( https://github.com/sindresorhus/got ) instance.
96
+ Returns a [ ` Got ` ] ( https://github.com/sindresorhus/got ) instance with a default ` responseType ` set to ` json ` .
103
97
104
98
#### options
105
99
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ const got4aws = (awsOptions: GotAWSOptions = {}) => {
43
43
const chain = new AWS . CredentialProviderChain ( credentialProviders as any ) ;
44
44
45
45
return got . extend ( {
46
+ responseType : 'json' ,
46
47
hooks : {
47
48
beforeRequest : [
48
49
async options => {
You can’t perform that action at this time.
0 commit comments