56 lines
1.5 KiB
Dart

// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'dart:convert';
class UnfreezedRequest {
final String method;
final Uri url;
final Map<String, String>? headers;
final Object? body;
final Encoding? encoding;
UnfreezedRequest({
required this.method,
required this.url,
this.headers,
this.body,
this.encoding,
});
UnfreezedRequest copyWith({
String? method,
Uri? url,
Map<String, String>? headers,
Object? body,
Encoding? encoding,
}) {
return UnfreezedRequest(
method: method ?? this.method,
url: url ?? this.url,
headers: headers ?? this.headers,
body: body ?? this.body,
encoding: encoding ?? this.encoding,
);
}
@override
String toString() {
return 'UnfreezedRequest(method: $method, url: $url, headers: '
'$headers, body: $body, encoding: $encoding)';
}
}