From add0cb37473b844334cf92b533144b3b64792093 Mon Sep 17 00:00:00 2001 From: Albert Tran Date: Sat, 27 Apr 2024 20:07:29 +0200 Subject: [PATCH] Addind reason phrase in ResponseData --- lib/src/middleware/http_with_middleware.dart | 1 + lib/src/middleware/models/response_data.dart | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/src/middleware/http_with_middleware.dart b/lib/src/middleware/http_with_middleware.dart index 4073164..30fc53d 100644 --- a/lib/src/middleware/http_with_middleware.dart +++ b/lib/src/middleware/http_with_middleware.dart @@ -159,6 +159,7 @@ class HttpWithMiddleware { responseData.method.toString().substring(7), Uri.parse(responseData.url), ), + reasonPhrase: responseData.reasonPhrase, ); return resultResponse as T; diff --git a/lib/src/middleware/models/response_data.dart b/lib/src/middleware/models/response_data.dart index 69e481e..5b2d6a0 100644 --- a/lib/src/middleware/models/response_data.dart +++ b/lib/src/middleware/models/response_data.dart @@ -33,6 +33,7 @@ class ResponseData { int? contentLength; bool? isRedirect; bool? persistentConnection; + String? reasonPhrase; ResponseData({ required this.method, @@ -44,6 +45,7 @@ class ResponseData { this.contentLength, this.isRedirect, this.persistentConnection, + this.reasonPhrase, }); factory ResponseData.fromHttpResponse(Response response) { @@ -57,6 +59,7 @@ class ResponseData { url: response.request!.url.toString(), method: methodFromString(response.request!.method), persistentConnection: response.persistentConnection, + reasonPhrase: response.reasonPhrase, ); } }