@@ -89,8 +89,8 @@ When making a request:
8989await request (' https://example.com' , {
9090 method: ' GET' ,
9191 data: {
92- ' a ' : ' hello' ,
93- ' b ' : ' world' ,
92+ a : ' hello' ,
93+ b : ' world' ,
9494 },
9595});
9696```
@@ -142,12 +142,12 @@ This example can use `options.data` with `application/json` content type:
142142await request (' https://example.com' , {
143143 method: ' POST' ,
144144 headers: {
145- ' content-type' : ' application/json'
145+ ' content-type' : ' application/json' ,
146146 },
147147 data: {
148148 a: ' hello' ,
149149 b: ' world' ,
150- }
150+ },
151151});
152152```
153153
@@ -170,11 +170,7 @@ Upload multi files with a `hello` field.
170170``` js
171171await request (' https://example.com/upload' , {
172172 method: ' POST' ,
173- files: [
174- __filename ,
175- fs .createReadStream (__filename ),
176- Buffer .from (' mock file content' ),
177- ],
173+ files: [__filename , fs .createReadStream (__filename ), Buffer .from (' mock file content' )],
178174 data: {
179175 hello: ' hello urllib with multi files' ,
180176 },
@@ -241,12 +237,14 @@ setGlobalDispatcher(mockAgent);
241237
242238const mockPool = mockAgent .get (' http://localhost:7001' );
243239
244- mockPool .intercept ({
245- path: ' /foo' ,
246- method: ' POST' ,
247- }).reply (400 , {
248- message: ' mock 400 bad request' ,
249- });
240+ mockPool
241+ .intercept ({
242+ path: ' /foo' ,
243+ method: ' POST' ,
244+ })
245+ .reply (400 , {
246+ message: ' mock 400 bad request' ,
247+ });
250248
251249const response = await request (' http://localhost:7001/foo' , {
252250 method: ' POST' ,
0 commit comments