Skip to content

Commit 36ca4a3

Browse files
add helper to determine content type
1 parent 93db917 commit 36ca4a3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/utils/content_type.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
String getContentType<T>(content) {
2+
switch (T) {
3+
case Map<String, dynamic>:
4+
return 'application/json';
5+
default:
6+
return 'text/plain';
7+
}
8+
}

0 commit comments

Comments
 (0)