@@ -89,6 +89,7 @@ class AuthApiHttpClient<TResponse> {
89
89
required Map <String , dynamic > body,
90
90
Map <String , String > additionaHeaders = const {},
91
91
bool preventPayloadLogging = false ,
92
+ bool apiPathIsFullUrl = false ,
92
93
kAuthRequirement authRequirement = kAuthRequirement.required ,
93
94
}) async
94
95
{
@@ -98,6 +99,7 @@ class AuthApiHttpClient<TResponse> {
98
99
additionaHeaders: additionaHeaders,
99
100
authRequirement: authRequirement,
100
101
preventPayloadLogging: preventPayloadLogging,
102
+ apiPathIsFullUrl: apiPathIsFullUrl,
101
103
method: kHttpMethod.post,
102
104
);
103
105
}
@@ -107,6 +109,7 @@ class AuthApiHttpClient<TResponse> {
107
109
Map <String , String > queryParameters = const {},
108
110
Map <String , String > additionaHeaders = const {},
109
111
bool preventPayloadLogging = false ,
112
+ bool apiPathIsFullUrl = false ,
110
113
kAuthRequirement authRequirement = kAuthRequirement.required ,
111
114
}) async
112
115
{
@@ -117,6 +120,7 @@ class AuthApiHttpClient<TResponse> {
117
120
additionaHeaders: additionaHeaders,
118
121
authRequirement: authRequirement,
119
122
preventPayloadLogging: preventPayloadLogging,
123
+ apiPathIsFullUrl: apiPathIsFullUrl,
120
124
method: kHttpMethod.get ,
121
125
);
122
126
}
@@ -126,6 +130,7 @@ class AuthApiHttpClient<TResponse> {
126
130
required Map <String , dynamic > body,
127
131
Map <String , String > additionaHeaders = const {},
128
132
bool preventPayloadLogging = false ,
133
+ bool apiPathIsFullUrl = false ,
129
134
kAuthRequirement authRequirement = kAuthRequirement.required ,
130
135
}) async
131
136
{
@@ -135,6 +140,7 @@ class AuthApiHttpClient<TResponse> {
135
140
additionaHeaders: additionaHeaders,
136
141
authRequirement: authRequirement,
137
142
preventPayloadLogging: preventPayloadLogging,
143
+ apiPathIsFullUrl: apiPathIsFullUrl,
138
144
method: kHttpMethod.put,
139
145
);
140
146
}
@@ -143,6 +149,7 @@ class AuthApiHttpClient<TResponse> {
143
149
required String apiPath,
144
150
Map <String , String > additionaHeaders = const {},
145
151
bool preventPayloadLogging = false ,
152
+ bool apiPathIsFullUrl = false ,
146
153
kAuthRequirement authRequirement = kAuthRequirement.required ,
147
154
}) async
148
155
{
@@ -152,6 +159,7 @@ class AuthApiHttpClient<TResponse> {
152
159
additionaHeaders: additionaHeaders,
153
160
authRequirement: authRequirement,
154
161
preventPayloadLogging: preventPayloadLogging,
162
+ apiPathIsFullUrl: apiPathIsFullUrl,
155
163
method: kHttpMethod.delete,
156
164
);
157
165
}
@@ -166,6 +174,7 @@ class AuthApiHttpClient<TResponse> {
166
174
Map <String , String > queryParameters = const {},
167
175
Map <String , String > additionaHeaders = const {},
168
176
bool preventPayloadLogging = false ,
177
+ required bool apiPathIsFullUrl,
169
178
kAuthRequirement authRequirement = kAuthRequirement.required ,
170
179
required kHttpMethod method,
171
180
}) async
@@ -177,14 +186,19 @@ class AuthApiHttpClient<TResponse> {
177
186
178
187
try
179
188
{
180
- final baseUrl = await onGetBaseUrl () ;
189
+ String finalUrl = apiPath ;
181
190
182
- if (apiPath. startsWith ( '/' ) )
191
+ if (! apiPathIsFullUrl )
183
192
{
184
- apiPath = apiPath.substring (1 );
185
- }
193
+ final baseUrl = await onGetBaseUrl ();
186
194
187
- final finalUrl = path.join (baseUrl, apiPath);
195
+ if (apiPath.startsWith ('/' ))
196
+ {
197
+ apiPath = apiPath.substring (1 );
198
+ }
199
+
200
+ finalUrl = path.join (baseUrl, apiPath);
201
+ }
188
202
189
203
if (preventPayloadLogging)
190
204
{
@@ -276,6 +290,7 @@ class AuthApiHttpClient<TResponse> {
276
290
queryParameters: queryParameters,
277
291
additionaHeaders: additionaHeaders,
278
292
preventPayloadLogging: preventPayloadLogging,
293
+ apiPathIsFullUrl: apiPathIsFullUrl,
279
294
authRequirement: authRequirement,
280
295
method: method,
281
296
);
0 commit comments