Closed Sadhorsephile closed 3 months ago
If we have a request like this:
@MultiPart() @POST('/api/some/path/') Future<SomeResponse> requestName({ @Part(name: 'full_name') required String fullName, @Part(name: 'birth_date') required DateTime birthDate,
we'll get a toJson() method have to add to DateTime Exception.
toJson() method have to add to DateTime
If part param doesn't have the toJson() method, we have to check whether this is DateTime. If so, we use atoIso8601String method.
toJson()
toIso8601String
Problem
If we have a request like this:
we'll get a
toJson() method have to add to DateTime
Exception.Solution
If part param doesn't have the
toJson()
method, we have to check whether this is DateTime. If so, we use atoIso8601String
method.