Skip to content

Commit 2ffb639

Browse files
committed
Add release notes about keyword arguments.
1 parent d0509fd commit 2ffb639

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea
2424

2525
### Unreleased
2626

27+
- [`Request[]` and `Response[]` Keyword Arguments](https://socketry.github.io/protocol-http/releases/index#request[]-and-response[]-keyword-arguments)
28+
2729
## See Also
2830

2931
- [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this

releases.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# Releases
22

33
## Unreleased
4+
5+
### `Request[]` and `Response[]` Keyword Arguments
6+
7+
The `Request[]` and `Response[]` methods now support keyword arguments as a convenient way to set various positional arguments.
8+
9+
```ruby
10+
# Request keyword arguments:
11+
client.get("/", headers: {"accept" => "text/html"}, authority: "example.com")
12+
13+
# Response keyword arguments:
14+
def call(request)
15+
return Response[200, headers: {"content-Type" => "text/html"}, body: "Hello, World!"]
16+
end
17+
```

0 commit comments

Comments
 (0)