Skip to content

GURL: A Simple curl Alternative That Works Everywhere

Notifications You must be signed in to change notification settings

matveynator/gurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GURL: A Simple curl Alternative That Works Everywhere

GURL is a lightweight command-line HTTP client with no external dependencies. It’s perfect for both modern and old systems, running smoothly without OpenSSL or other libraries. Whether you’re on a cutting-edge Linux server or ancient hardware, GURL just works.


Download and Install

You can download GURL using curl (no HTTPS required) for your platform. Replace <ARCHIVE_URL> with the appropriate link for your operating system and architecture from the table below:

sudo curl -L http://files.zabiyaka.net/gurl/latest/<PLATFORM>/<ARCH>/gurl -o /usr/local/bin/gurl; 
sudo chmod +x /usr/local/bin/gurl;

Replace <PLATFORM> and <ARCH> with your system’s name and architecture.


Here’s the updated table with all links properly included for each platform and sorted by popularity. Each section references the full file paths provided.


Supported Platforms and Binaries

Operating System Architectures and Download Links
Linux Linux amd64 386 arm arm64 loong64 mips mipsle mips64 mips64le ppc64 ppc64le riscv64 s390x
Windows Windows amd64 386 arm arm64
macOS macOS amd64 arm64
Android Android arm64
FreeBSD FreeBSD amd64 386 arm arm64 riscv64
OpenBSD amd64 386 arm arm64 ppc64 riscv64
NetBSD NetBSD amd64 386 arm arm64
Solaris amd64
Plan 9 amd64 386 arm
Illumos amd64
DragonFlyBSD amd64
AIX ppc64
Wasm js/wasm
Wasi wasip1

Note: Replace /usr/local/bin with an appropriate directory for your system if you lack permissions.


Installation:

  1. Download and Install for Linux x86_64:

    sudo curl -L http://files.zabiyaka.net/gurl/latest/linux/amd64/gurl -o /usr/local/bin/gurl; sudo chmod +x /usr/local/bin/gurl; 
  2. Download and Install for Windows (PowerShell):

    Invoke-WebRequest -Uri http://files.zabiyaka.net/gurl/latest/windows/amd64/gurl.exe -OutFile gurl.exe

How to Use GURL

GURL supports clear and descriptive options to make usage intuitive. Here are practical examples:


1. Basic GET Request

gurl example.com

Sends a simple GET request and outputs the response to the terminal.


2. Save Response to a File

gurl --output output.txt http://example.com

The --output option saves the response body to output.txt instead of displaying it in the terminal.


3. POST Data

gurl --request POST --data "key=value&key2=value2" http://example.com

Sends a POST request with form data using --data and explicitly sets the HTTP method with --request.


4. Upload Files and Fields (Multipart Form Data)

gurl --form "key=value" --form "file=@/path/to/file" http://example.com

Uploads both text fields and files using the --form option. Use key=@/path/to/file to upload files.


5. Custom Headers

gurl --header "Authorization: Bearer TOKEN" --header "Content-Type: application/json" http://example.com

Use --header to include custom headers in the request.


6. Send Cookies

gurl --cookie "session_id=abc123; user=example" http://example.com

The --cookie option sends cookies with the request.


7. Fail Silently on HTTP Errors

gurl --fail http://example.com/404

If an HTTP error (4xx or 5xx) is returned, GURL exits with a non-zero error code and suppresses the response body.


8. HEAD Request

gurl --head http://example.com

The --head option retrieves only the response headers.


9. Set User-Agent

gurl --useragent "CustomUserAgent/1.0" http://example.com

The --useragent option specifies a custom User-Agent header.


10. Set a Timeout

gurl --timeout 10s http://example.com

The --timeout option sets the maximum time GURL will wait for a response (e.g., 10s, 1m).


11. Download a File with Progress Display

gurl http://example.com/file.txt --output file.txt

When using --output to save a file, GURL automatically displays a download progress bar.


12. Silent Mode for Scripting

gurl --silent http://example.com > output.html

The --silent option suppresses all output, including progress and headers, for clean scripting.


13. Send JSON Data

gurl --request POST --header "Content-Type: application/json" --data '{"key":"value"}' http://example.com

Combines --header for content type and --data for JSON payload.


14. Verbose Output for Debugging

gurl --verbose http://example.com

The --verbose option prints detailed request and response information, useful for debugging.


15. Handle Timeouts and Failures

gurl --timeout 5s --fail http://example.com

Combines --timeout for a 5-second limit and --fail to exit silently on HTTP errors.