Files
2024-11-24 06:08:47 +05:30
..
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:01:04 +05:30
2024-11-24 06:08:47 +05:30

curl_parser

A well-tested and improved alternative to curl_converter.

A Dart package that provides a Curl class for parsing and formatting cURL commands.

Usage

  1. Add the package to your pubspec.yaml file

  2. Use the package:

import 'package:curl_converter/curl_converter.dart';

void main() {
  // Parse a cURL command
  final curlString = 'curl -X GET https://www.example.com/';
  final curl = Curl.parse(curlString);

  // Access parsed data
  print(curl.method); // GET
  print(curl.uri); // https://www.example.com/

  // Format Curl object to a cURL command
  final formattedCurlString = curl.toCurlString();
  print(formattedCurlString); // curl -X GET https://www.example.com/
}

See test folder for more example usages.

Features

  • Parse a cURL command into a Curl class instance.
  • Format a Curl object back into a cURL command.
  • Supports various options such as request method, headers, data, cookies, user-agent, and more.

License

This project is licensed under the Apache License 2.0. Fork of curl_converter.