Napful is a command-line tool designed to help developers interact with HTTP APIs by running predefined requests.
- List Requests: Easily list all requests saved in the requests folder.
- Execute Requests: Run a specific request by name.
To get started, you can clone the repository and compile the project using Cargo:
git clone https://github.com/thiagokoster/napful
cd napful
cargo build --release
Requests are defined in .txt
files within the requests
folder.
The file format follows:
# Request name
HTTP_METHOD(GET or POST) URL
Header1: value
Header2: value
Body (if applicable)
Here is an example:
# Get posts
GET https://jsonplaceholder.typicode.com/posts
# Create post
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json
Accept: application/json
{
"title": "foo",
"body": "bar"
}
To list all the requests from the requests
folder, use the following command:
napful list
To execute a request, use:
napful run "Get posts"
Napful will omit response headers by default. They can be enabled --headers
flag if necessary
napful run "Get posts" --headers
You can get the response body formatted by running the request with the --formated flag. This is especially useful for improving the readability of JSON responses.
napful run "Get posts" --formatted
Napful is released under the MIT License. See the LICENSE file for more details.