fix: http download fail (#61)

This commit is contained in:
Li Wei authored and GitHub committed 2022-12-14 12:12:39 +08:00
1 parent c62867e3ef
commit 0a4be165a5
14 files changed
+113 -54

No files matched your search

+16 -2
View File
@@ -2,17 +2,31 @@ import 'package:json_annotation/json_annotation.dart';
part 'request.g.dart';
@JsonSerializable()
@JsonSerializable(explicitToJson: true, genericArgumentFactories: true)
class Request {
String url;
Map<String, dynamic>? extra;
Request({
required this.url,
this.extra,
});
factory Request.fromJson(Map<String, dynamic> json) =>
_$RequestFromJson(json);
Map<String, dynamic> toJson() => _$RequestToJson(this);
}
@JsonSerializable()
class ReqExtraHttp {
String method = 'GET';
Map<String, String> headers = {};
String body = '';
ReqExtraHttp();
factory ReqExtraHttp.fromJson(Map<String, dynamic> json) =>
_$ReqExtraHttpFromJson(json);
Map<String, dynamic> toJson() => _$ReqExtraHttpToJson(this);
}