Showing
1 changed file
with
5 additions
and
0 deletions
| @@ -14,6 +14,8 @@ class Request<T> { | @@ -14,6 +14,8 @@ class Request<T> { | ||
| 14 | 14 | ||
| 15 | final Decoder<T>? decoder; | 15 | final Decoder<T>? decoder; | 
| 16 | 16 | ||
| 17 | + final ResponseInterceptor<T>? responseInterceptor; | ||
| 18 | + | ||
| 17 | /// The Http Method from this [Request] | 19 | /// The Http Method from this [Request] | 
| 18 | /// ex: `GET`,`POST`,`PUT`,`DELETE` | 20 | /// ex: `GET`,`POST`,`PUT`,`DELETE` | 
| 19 | final String method; | 21 | final String method; | 
| @@ -44,6 +46,7 @@ class Request<T> { | @@ -44,6 +46,7 @@ class Request<T> { | ||
| 44 | required this.files, | 46 | required this.files, | 
| 45 | required this.persistentConnection, | 47 | required this.persistentConnection, | 
| 46 | required this.decoder, | 48 | required this.decoder, | 
| 49 | + this.responseInterceptor, | ||
| 47 | }); | 50 | }); | 
| 48 | 51 | ||
| 49 | factory Request({ | 52 | factory Request({ | 
| @@ -57,6 +60,7 @@ class Request<T> { | @@ -57,6 +60,7 @@ class Request<T> { | ||
| 57 | FormData? files, | 60 | FormData? files, | 
| 58 | bool persistentConnection = true, | 61 | bool persistentConnection = true, | 
| 59 | Decoder<T>? decoder, | 62 | Decoder<T>? decoder, | 
| 63 | + ResponseInterceptor<T>? responseInterceptor, | ||
| 60 | }) { | 64 | }) { | 
| 61 | if (followRedirects) { | 65 | if (followRedirects) { | 
| 62 | assert(maxRedirects > 0); | 66 | assert(maxRedirects > 0); | 
| @@ -72,6 +76,7 @@ class Request<T> { | @@ -72,6 +76,7 @@ class Request<T> { | ||
| 72 | files: files, | 76 | files: files, | 
| 73 | persistentConnection: persistentConnection, | 77 | persistentConnection: persistentConnection, | 
| 74 | decoder: decoder, | 78 | decoder: decoder, | 
| 79 | + responseInterceptor: responseInterceptor | ||
| 75 | ); | 80 | ); | 
| 76 | } | 81 | } | 
| 77 | 82 | 
- 
Please register or login to post a comment