Skip to content

Commit 4208dd4

Browse files
committed
docs: added event listeners nav
1 parent a561c4d commit 4208dd4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A library for creating SDKs in PHP with support for:
1010
- [PSR-6 caches](https://www.php-fig.org/psr/psr-6);
1111
- [PSR-3 logs](https://www.php-fig.org/psr/psr-3);
1212
- Authentication;
13-
- Event Listeners;
13+
- Event listeners;
1414
- ...and more.
1515

1616
## Requirements
@@ -311,9 +311,13 @@ class YourApi extends Api
311311
}
312312
```
313313

314-
### Events Listeners
314+
### Event Listeners
315315

316316
Currently, there are two event listeners available:
317+
- [`addPostRequestHandler`](#addpostrequesthandler)
318+
- [`addResponseContentsHandler`](#addresponsecontentshandler)
319+
320+
#### `addPostRequestHandler`
317321

318322
The `addPostRequestHandler` method is used to add a handler function that is executed after a request has been made.
319323
This handler function can be used to inspect the request and response data that was sent to, and received from, the API.
@@ -355,6 +359,8 @@ class YourApi extends Api
355359
}
356360
```
357361

362+
#### `addResponseContentsHandler`
363+
358364
On the other hand, the `addResponseContentsHandler` method is used to manipulate the response that was received from the API.
359365
This event listener will be applied to every API request.
360366

0 commit comments

Comments
 (0)