Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raquentin/raquest
🏓 A batteries-excluded command-line HTTP client.
https://github.com/raquentin/raquest
cpp http
Last synced: about 2 months ago
JSON representation
🏓 A batteries-excluded command-line HTTP client.
- Host: GitHub
- URL: https://github.com/raquentin/raquest
- Owner: raquentin
- License: mit
- Created: 2024-08-10T16:20:18.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-14T20:45:19.000Z (3 months ago)
- Last Synced: 2024-09-15T05:29:31.283Z (3 months ago)
- Topics: cpp, http
- Language: C++
- Homepage:
- Size: 313 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🏓 raquest
Raquest is a batteries-excluded command-line HTTP client. No monthly subscriptions or two minute ads to send requests, just run `raq .raq` and move on with your life.
## Features
### `.raq` files
Requests are stored written in `'.raq'` files and resemble `curl` commands in bash scripts. The files consist of sections defining the request, its headers, its json payload, and assertions, which assert certain attributes of the repsonse. View these sections in action in the [examples](/examples) or conceptually below:
#### [request]
```
[request]
POST https://jsonplaceholder.typicode.com/posts
```
The `[request]` section is generally found at the top of the file and defines the HTTP method and the target url.#### [headers]
```
[headers]
Authorization: Bearer exampletoken12345
Content-Type: application/json
Custom-Header: custom_value
```
The `[headers]` section defines key-value header pairs.#### [body]
```
[body]
{
"title": "foo",
"age": 30,
"isActive": true,
"description": "here is the description"
}
```
The `[body]` section contains the request payload; its type is inferred from the `Content-Type` header in the `[headers]` section.#### [assertions]
```
[assertions]
status: 201, 303
json_field: title ^foo$
json_field: age 30
json_field: isActive true
json_field: description here is the description
```
`[assertions]` is an optional section that allows you to assert certain attributes of your request's response.## Todos for v1
- [x] support all request types
- [x] support json in files
- [x] support for headers
- [ ] cookies
- [ ] suggestive parser errors
- [ ] lsp
- [ ] support xml, plain, form, multipart, encoded
- [ ] good parser coverage
- [ ] mocked libcurl/fake server
- [ ] honorable usage docs
- [ ] decent contrib docs
- [ ] logging
- [x] assertions
- [ ] build & test ci on linux, win, macos## Development
### Dependencies
- cmake 3.24+
- g++ 14### Running Tests
```bash
mkdir -p build \
cd build \
cmake .. \
cmake --build . \
ctest
```### Clangd Setup
```bash
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1
```