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

使用dio進行發送自動生成的request請求, 搭配mx_request_generator使用.

example/mx_request_example.dart

import 'package:mx_request/mx_request.dart';
import 'package:dio/dio.dart';

Future<void> main() async {
  final content = RequestContent(
    scheme: 'https',
    host: 'google.com',
    method: RequestMethods.get,
    contentType: Headers.formUrlEncodedContentType,
  );

  // content.addHeader('Header1', value: 'Header1Value');
  // content.addQuery('Query1', value: 'Query1Value');
  // content.addBodyInKeyValue('BodyKV1', value: 'BodyKV1Value');

  final dio = Dio();
  await content.request(dio).then((value) {
    print('Response: $value');
  }).catchError((e, s) {
    print('Error: $e');
  });
}
0
likes
0
points
103
downloads

Publisher

unverified uploader

Weekly Downloads

使用dio進行發送自動生成的request請求, 搭配mx_request_generator使用.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio

More

Packages that depend on mx_request