A simple curl wrapper written in bash that can be used to make HTTP requests to API endpoints.
Find a file
Victor Westerlund 64db42527b refactor: preserve terminal screen and scrollbuffer (#13)
Maintain the terminal output. If clearing the screen and scrollbuffer is desired, it should be wrapped in an upstream script.

Reviewed-on: https://codeberg.org/vlw/curl/pulls/13
2026-04-12 10:42:17 +02:00
curl feat: save output of response headers and body to files (#3) 2026-03-14 10:40:50 +01:00
saved feat: add script to save and load configs (#5) 2026-03-29 13:47:09 +02:00
.gitignore feat: add script to save and load configs (#5) 2026-03-29 13:47:09 +02:00
curl.sh refactor: preserve terminal screen and scrollbuffer (#13) 2026-04-12 10:42:17 +02:00
init.sh docs: echo success message when new config is generated (#7) 2026-03-31 12:02:26 +02:00
LICENSE initial commit 2025-02-09 09:25:13 +01:00
README.md feat: print response code to CLI (#10) 2026-04-06 10:25:27 +02:00
save.sh feat: add script to save and load configs (#5) 2026-03-29 13:47:09 +02:00

curl-screenshot

license

This is a wrapper for curl written in bash designed to be used along with Visual Studio Code.

Mom, can we have Postman?

We have Postman at home!

- Source

Here is a simpler version of this script that prints the response body directly to the console

Get started

Clone this repo

git clone https://codeberg.org/vlw/curl --depth 1

This script uses separate files in the curl/ directory for various request options. You can generate these files on first load by running the init script.

./init.sh

Note

If you're using this with VSCode, drag each file into the workspace area where you want it to display. You of course don't have to follow the layout in the screenshot above.

Files

This script reads or writes values in these files to construct a request or show a response from a request.

Disable SSL peer validation

You can disable SSL peer validation (for self-signed certificates etc.) by creating an empty file disable_peer_validation in the base directory of this repo.

touch disable_peer_validation

Request

curl/req_params.txt

URL search parameters. Each newline is treated as a separate search parameter.

foo=bar
fizz=buzz

curl/req_body.json

JSON request body that will be sent with all requests (except GET). Leave empty to send nothing.

{
    "request_body_parameter": "request_body_value"
}

curl/req_headers.json

Key-value JSON object of optional request headers.

{
    "X-Header-Name": "Header value"
}

Response

curl/resp_headers.txt

A raw output of the response headers from the last request

curl/resp_body.txt

The raw response body received from the last request

curl/resp_body.json

The raw response body parsed into- and automatically pretty-printed JSON

Make a request

Run the curl.sh file from your shell and pass it two parametes for URL and request method.

./curl.sh https://example.com GET

Save and load configurations

The save.sh script allows you to save and load configurations so you can easily switch between them.

Command Description
./save.sh save <name> Save the current configuration where <name> is the name of this configuration
./save.sh move <name> Move the current configuration where <name> is the name of this configuration. A new empty configuration will be created.
./save.sh load <name> Load a saved configuration where <name> is the name of the target configuration. The current configuration will be saved as ._backup.
./save.sh list List all saved configurations