Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/yididiyan/dio2curl
- Owner: yididiyan
- License: mit
- Created: 2019-06-06T12:42:40.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-15T09:54:05.000Z (about 3 years ago)
- Last Synced: 2024-04-29T00:11:22.244Z (8 months ago)
- Topics: curl, dart, dartlang, dio, flutter
- Language: Dart
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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));
});
}
```