mirror of
https://github.com/foss42/apidash.git
synced 2025-12-10 07:08:08 +08:00
Add curl_parser
This commit is contained in:
15
packages/curl_parser/example/curl_parser_example.dart
Normal file
15
packages/curl_parser/example/curl_parser_example.dart
Normal 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/""
|
||||
}
|
||||
Reference in New Issue
Block a user