mx_request 1.0.0 copy "mx_request: ^1.0.0" to clipboard
mx_request: ^1.0.0 copied to clipboard

可自動化生成request請求內容的工具, 核心為使用dio進行發送自動生成的request請求.

example/mx_request_example.dart

import 'package:mx_request/mx_request.dart';

import 'request.dart';

Future<void> main() async {
  // 初始化http請求工具
  final dio = Dio();

  // 初始化api接口實體
  final request = ExRequest();

  print('發出請求');

  // 發出http api請求, 並取得響應
  await dio
      .connect(request.exApi(
    'apiPath',
    'hi',
    'bToken',
    'cBody',
    'rawBody',
    opBodyFile: MultipartFile.fromString('value'),
    check: 'check',
    opId: 'opId',
    opId2: ['opId2'],
  ))
      .then((value) {
    print('響應: $value');
  }).catchError((e, s) {
    print('錯誤: $e');
  });
}
0
likes
0
points
103
downloads

Publisher

unverified uploader

Weekly Downloads

可自動化生成request請求內容的工具, 核心為使用dio進行發送自動生成的request請求.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, built_collection, code_builder, dart_style, dio, meta, source_gen

More

Packages that depend on mx_request