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

48 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.36.
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}) =>
2024-05-22 20:05:50 +08:00
RustLib.instance.api
.crateApiHttpApiSetDefaultHeader(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-05-22 20:05:50 +08:00
RustLib.instance.api.crateApiHttpApiFetch(
2024-02-07 19:32:36 +08:00
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}) =>
2024-05-22 20:05:50 +08:00
RustLib.instance.api.crateApiHttpApiDnsLookupTxt(host: host, hint: hint);
2024-02-07 22:19:43 +08:00
2024-03-12 20:07:06 +08:00
Future<List<String>> dnsLookupIps({required String host, dynamic hint}) =>
2024-05-22 20:05:50 +08:00
RustLib.instance.api.crateApiHttpApiDnsLookupIps(host: host, hint: hint);
2024-03-12 20:07:06 +08:00
2024-02-07 19:32:36 +08:00
enum MyMethod {
options,
gets,
post,
put,
delete,
head,
trace,
connect,
patch,
2024-04-16 19:29:19 +08:00
;
2024-02-07 19:32:36 +08:00
}