app/lib/common/rust/api/http_api.dart

46 lines
1.3 KiB
Dart
Raw Normal View History

2024-02-07 00:20:06 +08:00
// This file is automatically generated, so please do not edit it.
// Generated by `flutter_rust_bridge`@ 2.0.0-dev.28.
2024-02-07 00:20:06 +08:00
// ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import
import '../frb_generated.dart';
2024-02-07 19:32:36 +08:00
import '../http_package.dart';
2024-02-07 00:20:06 +08:00
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
2024-02-07 19:32:36 +08:00
Future<void> setDefaultHeader(
{required Map<String, String> headers, dynamic hint}) =>
RustLib.instance.api.setDefaultHeader(headers: headers, hint: hint);
2024-02-07 00:20:06 +08:00
2024-02-07 19:32:36 +08:00
Future<RustHttpResponse> fetch(
{required MyMethod method,
required String url,
2024-02-07 00:20:06 +08:00
Map<String, String>? headers,
2024-02-07 19:32:36 +08:00
Uint8List? inputData,
2024-03-12 20:07:06 +08:00
String? withIpAddress,
2024-02-07 00:20:06 +08:00
dynamic hint}) =>
2024-02-07 19:32:36 +08:00
RustLib.instance.api.fetch(
method: method,
url: url,
headers: headers,
inputData: inputData,
2024-03-12 20:07:06 +08:00
withIpAddress: withIpAddress,
2024-02-07 19:32:36 +08:00
hint: hint);
2024-02-07 22:19:43 +08:00
Future<List<String>> dnsLookupTxt({required String host, dynamic hint}) =>
RustLib.instance.api.dnsLookupTxt(host: host, hint: hint);
2024-03-12 20:07:06 +08:00
Future<List<String>> dnsLookupIps({required String host, dynamic hint}) =>
RustLib.instance.api.dnsLookupIps(host: host, hint: hint);
2024-02-07 19:32:36 +08:00
enum MyMethod {
options,
gets,
post,
put,
delete,
head,
trace,
connect,
patch,
}