-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: create layout for documentation website
- Loading branch information
Showing
7 changed files
with
222 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<template> | ||
<div class="w-full min-h-screen h-full"> | ||
<NuxtPage /> | ||
<div class="min-h-screen h-full flex gap-8 p-8 w-full"> | ||
<NuxtLayout> | ||
<NuxtPage /> | ||
</NuxtLayout> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# hitt | ||
|
||
hitt is a command line HTTP testing tool focused on speed and simplicity. | ||
|
||
## Install | ||
|
||
hitt can be installed using Cargo, the package manager for Rust. | ||
|
||
```sh | ||
cargo install hitt | ||
``` | ||
|
||
## Usage | ||
|
||
To send a request create a file ending in `.http`. | ||
|
||
The syntax of `.http` files is pretty straightforward: | ||
|
||
```text | ||
GET https://mhouge.dk/ | ||
``` | ||
|
||
The file can then be run using the following command: | ||
|
||
```sh | ||
hitt run <PATH_TO_FILE> | ||
``` | ||
|
||
That is all that is need to send a request. | ||
|
||
### Request headers | ||
|
||
Request headers can be added by writing key value pairs (`KEY:VALUE`) on a new line after the method and URL: | ||
|
||
```text | ||
GET https://mhouge.dk/ | ||
key:value | ||
``` | ||
|
||
Leading spaces in the header value is ignored, so `KEY: VALUE` and `KEY:VALUE` will both have the value `VALUE`. | ||
|
||
### Request body | ||
|
||
A body can be sent with the request by creating a blank line, followed by the desired body input. | ||
|
||
Please note, hitt **does not** infer content type. That has to be written as a header. | ||
|
||
```text | ||
POST https://mhouge.dk/ | ||
content-type:application/json | ||
{ | ||
"key": "value" | ||
} | ||
``` | ||
|
||
### Multiple request in single file | ||
|
||
Multiple requests can be written in a single file by adding a line with `###` as a separator: | ||
|
||
```text | ||
GET https://mhouge.dk/ | ||
### | ||
GET https://mhouge.dk/ | ||
``` | ||
|
||
### Exiting on 4XX and 5XX status codes | ||
|
||
By default, hitt does not exit on error status codes. That behavior can be changed by supplying the `--fail-fast` argument. | ||
|
||
```sh | ||
hitt run --fail-fast <PATH_TO_FOLDER> | ||
``` | ||
|
||
### Running all files in directory | ||
|
||
The `--recursive` argument can be passed to run all files in a directory: | ||
|
||
```sh | ||
hitt run --recursive <PATH_TO_FOLDER> | ||
``` | ||
|
||
The order of each file execution is platform and file system dependent. That might change in the future, but for now you **should not** rely on the order. | ||
|
||
### Hiding response headers | ||
|
||
The `--hide-headers` argument can be passed to hide the response headers in the output: | ||
|
||
```sh | ||
hitt run --hide-headers <PATH_TO_FILE> | ||
``` | ||
|
||
### Hiding response body | ||
|
||
The `--hide-body` argument can be passed to hide the response body in the output: | ||
|
||
```sh | ||
hitt run --hide-body <PATH_TO_FILE> | ||
``` | ||
|
||
### Disabling pretty printing | ||
|
||
The `--disable-formatting` argument can be passed to disable pretty printing of response body: | ||
|
||
```sh | ||
hitt run --disable-formatting <PATH_TO_FILE> | ||
``` | ||
|
||
## Neovim | ||
|
||
hitt can be run directly from Neovim. | ||
|
||
> [!NOTE] | ||
> The `hitt` executable must be available in your path for the plugin to work. | ||
### Install | ||
|
||
#### Lazy | ||
|
||
```lua | ||
local hitt_plugin = { | ||
"hougesen/hitt", | ||
opts = {}, | ||
} | ||
``` | ||
|
||
### Usage | ||
|
||
The plugin exposes a single command `:HittSendRequest`, which can be bound to a keymap like this: | ||
|
||
```lua | ||
-- ~/.config/nvim/after/plugin/hitt.lua | ||
|
||
local hitt = require("hitt") | ||
|
||
vim.keymap.set("n", "<leader>rr", hitt.HittSendRequest, {}) | ||
``` | ||
|
||
![hitt neovim window](/docs/public/hitt-neovim-window.png) | ||
|
||
### Configuration | ||
|
||
| Name | Default | Description | | ||
| ------------- | ------- | --------------------------------- | | ||
| window_width | 80 | Window width in percentage | | ||
| window_height | 80 | Window height in percentage | | ||
| fail_fast | false | Enables the `--fail-fast` options | | ||
|
||
## Disclaimer | ||
|
||
hitt is most likely not ready for main stream usage. I ([Mads Hougesen](https://mhouge.dk)) am primarily developing it based on features I believe to be useful, or fun to develop. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<template> | ||
<article class="mx-auto container prose lg:prose-xl"> | ||
<slot></slot> | ||
</article> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters