Skip to content

Commit 1e69db4

Browse files
committed
docs: update readme
1 parent 167a70a commit 1e69db4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,24 @@ const response = new HttpClient()
328328
</details>
329329

330330
<details>
331-
<summary><b>7. Testing</b></summary>
331+
<summary><b>7. Set request timeout</b></summary>
332+
333+
The HTTP Clients offers a `timeout` method to specify the maximum number of milliseconds to wait for a response.
334+
335+
The `timeout` method accepts the maximum number of milliseconds the request should wait for a response.
336+
337+
```typescript
338+
import { HttpClient } from '@wolfpackthatcodes/http-client';
339+
340+
const response = new HttpClient()
341+
.timeout(1000)
342+
.get('https://api.example.local/test/');
343+
```
344+
345+
</details>
346+
347+
<details>
348+
<summary><b>8. Testing</b></summary>
332349

333350
The HTTP Client offers a `fake` method that allows you to instruct the HTTP Client to return mocked responses when requests are made. The `fake` method will prevent the HTTP Client to make a HTTP request.
334351

0 commit comments

Comments
 (0)