Update curl_parser_example.dart

This commit is contained in:
Ashita Prasad
2024-11-24 06:13:29 +05:30
parent dc1320e766
commit 51355b8a10

View File

@ -2,14 +2,14 @@ import 'package:curl_parser/curl_parser.dart';
void main() {
// Parse a cURL command
final curlString = 'curl -X GET https://www.example.com/';
final curlString = 'curl -X GET https://api.apidash.dev/';
final curl = Curl.parse(curlString);
// Access parsed data
print(curl.method); // GET
print(curl.uri); // https://www.example.com/
print(curl.uri); // https://api.apidash.dev/
// Format Curl object to a cURL command
final formattedCurlString = curl.toCurlString();
print(formattedCurlString); // curl "https://www.example.com/""
print(formattedCurlString); // curl "https://api.apidash.dev/""
}