curl2http Converter
Convert cURL commands to REST CLI request files.
Last updated: November 22, 2025
curl2http Converter
Convert cURL commands to REST CLI request files.
Basic Usage
restcli curl2http 'curl https://api.example.com/users'
From clipboard:
pbpaste | restcli curl2http
Flags
Output File
restcli curl2http -o request.http
Short: -o
Import Headers
restcli curl2http --import-headers
Converts cURL headers to profile headers format.
Output Format
restcli curl2http -f json
Options: http, yaml, json, jsonc
Default: http
Short: -f
Examples
Simple GET
Copy this cURL command:
curl https://api.example.com/users
Convert from clipboard:
pbpaste | restcli curl2http -o get-users.http
Result:
### Request
GET https://api.example.com/users
With Headers
Copy:
curl -H "Authorization: Bearer token123" -H "Accept: application/json" https://api.example.com/users
Convert:
pbpaste | restcli curl2http -o get-users.http
Result:
### Request
GET https://api.example.com/users
Authorization: Bearer token123
Accept: application/json
POST with Body
Copy:
curl -X POST https://api.example.com/users -H "Content-Type: application/json" -d '{"name":"John","email":"[email protected]"}'
Convert:
pbpaste | restcli curl2http -o create-user.http
Result:
### Request
POST https://api.example.com/users
Content-Type: application/json
{
"name": "John",
"email": "[email protected]"
}
YAML Output
pbpaste | restcli curl2http -f yaml -o get-users.yaml
Result:
name: Request
method: GET
url: "https://api.example.com/users"
JSON Output
pbpaste | restcli curl2http -f json -o create-user.json
Result:
{
"name": "Request",
"method": "POST",
"url": "https://api.example.com/users",
"headers": {
"Content-Type": "application/json"
},
"body": "{\"name\":\"John\"}"
}
Import Headers
pbpaste | restcli curl2http --import-headers
Extracts headers to profile format:
{
"headers": {
"Authorization": "Bearer token123",
"X-API-Key": "key456"
}
}
Workflow
From Browser DevTools
- Open browser DevTools
- Go to Network tab
- Right-click request
- Select “Copy as cURL”
- Paste and convert:
pbpaste | restcli curl2http -o request.http
From Documentation
Copy cURL example from API docs:
pbpaste | restcli curl2http -f yaml -o api-call.yaml
Supported cURL Flags
| Flag | Support | Description |
|---|---|---|
-X |
Yes | HTTP method |
-H |
Yes | Headers |
-d |
Yes | Request body |
--data |
Yes | Request body |
-u |
Partial | Converted to Authorization header |
--user |
Partial | Converted to Authorization header |
Limitations
- Complex cURL scripts may not convert perfectly
- Shell variables in cURL not converted to REST CLI variables
- Some advanced cURL features unsupported
For complex cases, manually edit converted files.