Skip to content

Commit

Permalink
Add release notes about keyword arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 30, 2024
1 parent d0509fd commit 2ffb639
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Please see the [project releases](https://socketry.github.io/protocol-http/relea

### Unreleased

- [`Request[]` and `Response[]` Keyword Arguments](https://socketry.github.io/protocol-http/releases/index#request[]-and-response[]-keyword-arguments)

## See Also

- [protocol-http1](https://github.com/socketry/protocol-http1) — HTTP/1 client/server implementation using this
Expand Down
14 changes: 14 additions & 0 deletions releases.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Releases

## Unreleased

### `Request[]` and `Response[]` Keyword Arguments

The `Request[]` and `Response[]` methods now support keyword arguments as a convenient way to set various positional arguments.

```ruby
# Request keyword arguments:
client.get("/", headers: {"accept" => "text/html"}, authority: "example.com")

# Response keyword arguments:
def call(request)
return Response[200, headers: {"content-Type" => "text/html"}, body: "Hello, World!"]
end
```

0 comments on commit 2ffb639

Please sign in to comment.