Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iskyd/zurl
Curl wrapper in Zig
https://github.com/iskyd/zurl
Last synced: 11 days ago
JSON representation
Curl wrapper in Zig
- Host: GitHub
- URL: https://github.com/iskyd/zurl
- Owner: iskyd
- Created: 2024-04-15T16:21:51.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-10T10:44:33.000Z (9 months ago)
- Last Synced: 2025-01-03T03:36:21.016Z (17 days ago)
- Language: Zig
- Size: 48.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Zurl #
Zurl is a command-line tool written in Zig, designed to provide a simplified interface to perform HTTP requests, inspired by the functionality of `curl`. Zurl aims to offer additional features and ease of use, including the ability to save and replay requests, automatic management of authentication requests, and more.
Zurl uses libcurl under the hood to handle HTTP requests and responses and sqlite3 as storage to save the requests.
### Building from source
Zurl can be built using devbox to create a dev shell with all the necessary dependencies.
``` bash
git clone [email protected]:iskyd/zurl.git
cd zurl
zig build
```### Usage
Executing a GET request
``` bash
zurl --method GET --header Content-type=application/json https://pokeapi.co/api/v2/pokemon/mewtwo | jq .stats
```Zurl supports headers, query (query params) and json.
``` bash
zurl --method GET --query key=value --header Content-type=application/json https://pokeapi.co/api/v2/pokemon/mewtwo | jq .stats
zurl --method POST --json '{"key": "value"}' --query key=value --header Content-type=application/json https://api.example.com
```Initialize the sqlite database to save the requests.
``` bash
zurl --init --db zurl.db
```Save the current request.
``` bash
zurl --save pokemon/mewtwo --db zurl.db --method GET https://pokeapi.co/api/v2/pokemon/mewtwo
```Execute a saved request.
``` bash
zurl --find pokemon/mewtwo --db zurl.db
```List all the saved requests (support --filter)
``` bash
zurl --db zurl.db --list
zurl --db zurl.db --list --filter pokemon%
```