mirror of
https://github.com/mountain-loop/yaak.git
synced 2025-12-23 22:48:55 -05:00
Copy as cUrl
A request action plugin for Yaak that converts HTTP requests into curl commands, making it easy to share, debug, and execute requests outside Yaak.
Overview
This plugin adds a 'Copy as Curl' action to HTTP requests, converting any request into its
equivalent curl command. This is useful for debugging, sharing requests with team members,
and executing requests in terminal environments where curl is available.
How It Works
The plugin analyzes the given HTTP request and generates a properly formatted curl command that includes:
- HTTP method (GET, POST, PUT, DELETE, etc.)
- Request URL with query parameters
- Headers (including authentication headers)
- Request body (for POST, PUT, PATCH requests)
- Authentication credentials
Usage
- Configure an HTTP request as usual in Yaak
- Right-click on the request in the sidebar
- Select 'Copy as Curl'
- The command is copied to your clipboard
- Share or execute the command
Generated Curl Examples
Simple GET Request
curl -X GET 'https://api.example.com/users' \
--header 'Accept: application/json'
POST Request with JSON Data
curl -X POST 'https://api.example.com/users' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"name": "John Doe",
"email": "john@example.com"
}'
Request with Multi-part Form Data
curl -X POST 'yaak.app' \
--header 'Content-Type: multipart/form-data' \
--form 'hello=world' \
--form file=@/path/to/file.json
Request with Authentication
curl -X GET 'https://api.example.com/protected' \
--user 'username:password'
