toolbox timestamp convert

This commit is contained in:
wanghongenpin
2024-11-08 21:00:52 +08:00
parent 799008fe47
commit 9dd69b567f
9 changed files with 154 additions and 69 deletions

View File

@@ -90,10 +90,17 @@ abstract class HttpMessage {
return mediaType.charset ?? MediaType.defaultCharset(mediaType);
}
///获取消息
String get bodyAsString {
return getBodyString(charset: 'utf-8');
}
String getBodyString({String? charset}) {
if (body == null || body?.isEmpty == true) {
return "";
}
charset ??= this.charset;
try {
List<int> rawBody = body!;
if (headers.contentEncoding == 'br') {