Skip to content

Commit 32fcf5f

Browse files
committed
Update readme for yapi send
1 parent c090b75 commit 32fcf5f

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,39 @@ make install
8181

8282
-----
8383

84+
## ⚡ Quick Requests with `yapi send`
85+
86+
Don't want to create a file? Use `yapi send` for one-off requests directly from the command line.
87+
88+
```bash
89+
# Simple GET
90+
yapi send https://jsonplaceholder.typicode.com/posts/1
91+
92+
# POST with JSON body (method auto-detected when body is provided)
93+
yapi send https://httpbin.org/post '{"title":"Hello from yapi"}'
94+
95+
# Explicit method, custom headers
96+
yapi send -X PUT https://httpbin.org/put '{"updated":true}' \
97+
-H 'Authorization: Bearer my-token'
98+
99+
# Filter response with jq
100+
yapi send https://jsonplaceholder.typicode.com/posts/1 --jq '.title'
101+
102+
# TCP request
103+
yapi send 'tcp://tcpbin.com:4242' 'Hello from yapi!'
104+
```
105+
106+
**Flags:**
107+
- `-X, --method` - HTTP method (default: GET, or POST if body is provided)
108+
- `-H, --header` - Custom headers (repeatable, e.g. `-H 'Key: Value'`)
109+
- `-v, --verbose` - Show request details, timing, and response headers
110+
- `--json` - Output full result as JSON with metadata
111+
- `--jq` - Apply a JQ filter to the response
112+
113+
Transport is auto-detected from the URL scheme: `tcp://` for TCP, `grpc://` for gRPC, and HTTP by default.
114+
115+
-----
116+
84117
## 📚 Examples
85118

86119
**yapi** speaks many protocols. Here is how you define them.

0 commit comments

Comments
 (0)