Scurl (Simple-curl) is a command-line tool for making HTTP requests. It provides a simplified interface for sending GET, HEAD, and POST requests with support for custom headers and data.
- Clone the repository:
git clone https://github.com/davidonlinearchive/scurl.git
- Build the binary:
go mod download go build
- Run the tool:
./scurl [url]
scurl [url]This will send a GET request to the provided URL. If no subcommand is specified, it defaults to get.
Send a GET request to the specified URL.
Example:
scurl get https://example.comSend a HEAD request to the specified URL. This retrieves only the headers.
Example:
scurl head https://example.comSend a POST request with custom data and headers.
Example:
scurl post https://example.com/post -d '{"key":"value"}' -H "Content-Type: application/json"| Flag | Long Form | Description | Example |
|---|---|---|---|
-d |
--data |
HTTP POST data | -d '{"key":"value"}' |
-H |
--header |
Set request headers | -H "Content-Type: application/json" |
- GET / HEAD / POST support
- Custom headers for requests
- Pretty-printed JSON/XML responses
- URLs without
http://orhttps://are automatically prefixed withhttp://. - The tool uses the
github.com/spf13/cobralibrary for CLI handling. - All responses are printed to stdout with proper formatting.
Feel free to open issues or submit pull requests! For feature requests or bug reports, please check the GitHub repository.