diff --git a/readme.md b/readme.md index 5d40f99..25cd1d3 100644 --- a/readme.md +++ b/readme.md @@ -22,7 +22,7 @@ Please see the [project documentation](https://socketry.github.io/protocol-http/ Please see the [project releases](https://socketry.github.io/protocol-http/releases/index) for all releases. -### Unreleased +### v0.30.0 - [`Request[]` and `Response[]` Keyword Arguments](https://socketry.github.io/protocol-http/releases/index#request[]-and-response[]-keyword-arguments) - [Interim Response Handling](https://socketry.github.io/protocol-http/releases/index#interim-response-handling) diff --git a/releases.md b/releases.md index 652f758..43eba2e 100644 --- a/releases.md +++ b/releases.md @@ -1,12 +1,12 @@ # Releases -## Unreleased +## v0.30.0 ### `Request[]` and `Response[]` Keyword Arguments The `Request[]` and `Response[]` methods now support keyword arguments as a convenient way to set various positional arguments. -```ruby +``` ruby # Request keyword arguments: client.get("/", headers: {"accept" => "text/html"}, authority: "example.com") @@ -21,14 +21,14 @@ The `Request` class now exposes a `#interim_response` attribute which can be use On the client side, you can pass a callback using the `interim_response` keyword argument which will be invoked whenever an interim response is received: -```ruby +``` ruby client = ... response = client.get("/index", interim_response: proc{|status, headers| ...}) ``` On the server side, you can send an interim response using the `#send_interim_response` method: -```ruby +``` ruby def call(request) if request.headers["expect"] == "100-continue" # Send an interim response: