Add curl_parser

This commit is contained in:
Ashita Prasad
2024-11-24 06:01:04 +05:30
parent 344960e1df
commit 5df562d73a
12 changed files with 875 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import 'package:curl_parser/curl_parser.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 "https://www.example.com/""
}