Skip to content

Commit 753f488

Browse files
committed
FIXUP
1 parent 884f067 commit 753f488

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ When making a request:
8989
await 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:
142142
await 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
171171
await 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

242238
const 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

251249
const response = await request('http://localhost:7001/foo', {
252250
method: 'POST',

0 commit comments

Comments
 (0)