File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ A library for creating SDKs in PHP with support for:
10
10
- [ PSR-6 caches] ( https://www.php-fig.org/psr/psr-6 ) ;
11
11
- [ PSR-3 logs] ( https://www.php-fig.org/psr/psr-3 ) ;
12
12
- Authentication;
13
- - Event Listeners ;
13
+ - Event listeners ;
14
14
- ...and more.
15
15
16
16
## Requirements
@@ -311,9 +311,13 @@ class YourApi extends Api
311
311
}
312
312
```
313
313
314
- ### Events Listeners
314
+ ### Event Listeners
315
315
316
316
Currently, there are two event listeners available:
317
+ - [ ` addPostRequestHandler ` ] ( #addpostrequesthandler )
318
+ - [ ` addResponseContentsHandler ` ] ( #addresponsecontentshandler )
319
+
320
+ #### ` addPostRequestHandler `
317
321
318
322
The ` addPostRequestHandler ` method is used to add a handler function that is executed after a request has been made.
319
323
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
355
359
}
356
360
```
357
361
362
+ #### ` addResponseContentsHandler `
363
+
358
364
On the other hand, the ` addResponseContentsHandler ` method is used to manipulate the response that was received from the API.
359
365
This event listener will be applied to every API request.
360
366
You can’t perform that action at this time.
0 commit comments