mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 09:04:45 +08:00
更换 Dio -> RSHttp
This commit is contained in:
@ -14,10 +14,16 @@ class RSHttp {
|
||||
});
|
||||
}
|
||||
|
||||
static Future<String> getText(String url,
|
||||
static Future<RustHttpResponse> get(String url,
|
||||
{Map<String, String>? headers}) async {
|
||||
final r = await rust_http.fetch(
|
||||
method: MyMethod.gets, url: url, headers: headers);
|
||||
return r;
|
||||
}
|
||||
|
||||
static Future<String> getText(String url,
|
||||
{Map<String, String>? headers}) async {
|
||||
final r = await get(url, headers: headers);
|
||||
if (r.data == null) return "";
|
||||
final str = utf8.decode(r.data!);
|
||||
return str;
|
||||
|
Reference in New Issue
Block a user