Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yididiyan/dio2curl

Converts Dart Dio requests to curl
https://github.com/yididiyan/dio2curl

curl dart dartlang dio flutter

Last synced: about 1 month ago
JSON representation

Converts Dart Dio requests to curl

Awesome Lists containing this project

README

        

# dio2curl -
Converts dio requests to curl format

## Usage
```dart
import 'dart:convert';
import 'package:dio2curl/dio2curl.dart';
import 'package:dio/dio.dart';

void main() async{
var dio = Dio();

final data = {
"title": "voluptate et itaque vero tempora molestiae",
"body": "eveniet quo quis laborum totam consequatur non dolor ut et est repudiandae est voluptatem vel debitis et magnam"
};

dio.post(
"https://jsonplaceholder.typicode.com/posts",
data: json.encode(data),
options: Options(
responseType: ResponseType.json,
headers: {
'Authorization': 'Bearer asdkfjalskdfjSomebullshit',
},

)).then((response) {
print(dio2curl(response.request));
});

}
```