diff --git a/CHANGELOG.md b/CHANGELOG.md index f4c29fee..1d0f2aee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # 2.0.2 * `_join` previously discarded quer parameters, etc. +* Allow any `Map` as body, not just `Map`. # 2.0.1 * Change `BaseAngelClient` constructor to accept `dynamic` instead of `String` for `baseUrl. diff --git a/lib/base_angel_client.dart b/lib/base_angel_client.dart index f11eb3aa..7912243b 100644 --- a/lib/base_angel_client.dart +++ b/lib/base_angel_client.dart @@ -138,8 +138,9 @@ abstract class BaseAngelClient extends Angel { request.body = body; } else if (body is List) { request.bodyBytes = new List.from(body); - } else if (body is Map) { - request.bodyFields = new Map.from(body); + } else if (body is Map) { + request.bodyFields = + body.map((k, v) => MapEntry(k, v is String ? v : v.toString())); } else { throw new ArgumentError.value(body, 'body', 'must be a String, List, or Map.');