A Steel Scheme library that translates http format requests into curl commands.
- Parse http format requests (REST Client format)
- Generate valid curl commands with proper shell escaping
- Support for all HTTP methods (GET, POST, PUT, DELETE, PATCH, etc.)
- Variable substitution with
{{varName}}syntax - Multiple requests per file (separated by
###) - Accepts list of strings (perfect for Helix editor)
- Request bodies (JSON, plain text, multiline)
- External file references (
< filepath) - Optional response headers flag (
-i) - Single-file library for easy deployment
(require "http2curl.scm")
;; Simple GET request
(http->curl "GET https://api.example.com/users HTTP/1.1" '())
;; => ("curl https://api.example.com/users")
;; POST with JSON and variables
(http->curl
"POST {{baseUrl}}/users HTTP/1.1
Content-Type: application/json
{\"name\":\"{{userName}}\"}"
'(("baseUrl" . "https://api.example.com")
("userName" . "John Doe")))
;; => ("curl -X POST -H \"Content-Type: application/json\" --data-raw '{\"name\":\"John Doe\"}' https://api.example.com/users")
;; Multi-selection (Helix editor)
(http->curl
'("GET https://api.example.com/users HTTP/1.1"
"GET https://api.example.com/posts HTTP/1.1"
"GET https://api.example.com/comments HTTP/1.1")
'())
;; => ("curl https://api.example.com/users"
;; "curl https://api.example.com/posts"
;; "curl https://api.example.com/comments")See USAGE.md for complete documentation and examples.
Copy http2curl.scm to your project directory or Steel load path.
steel tests/test.scm # Run test suite
steel tests/test-multi-selection.scm # Run tests for list input
steel tests/validate.scm # Run validation tests with real endpointsMIT License - Copyright (c) 2025 Tom Waddington
See LICENSE file for details.