You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,18 @@ Please see the [project documentation](https://socketry.github.io/async-http/) f
12
12
13
13
-[Testing](https://socketry.github.io/async-http/guides/testing/index) - This guide explains how to use `Async::HTTP` clients and servers in your tests.
14
14
15
+
## Releases
16
+
17
+
Please see the [project releases](https://socketry.github.io/async-http/releases/index) for all releases.
`Protocol::HTTP::Request` now supports an `interim_response` callback, which will be called with the interim response status and headers. This works on both the client and the server:
24
+
25
+
```ruby
26
+
# Server side:
27
+
defcall(request)
28
+
if request.headers['expect'].include?('100-continue')
29
+
request.send_interim_response(100)
30
+
end
31
+
32
+
# ...
33
+
end
34
+
35
+
# Client side:
36
+
body =Async::HTTP::Body::Writable.new
37
+
38
+
interim_repsonse =procdo |status, headers|
39
+
if status ==100
40
+
# Continue sending the body...
41
+
body.write("Hello, world!")
42
+
body.close
43
+
end
44
+
end
45
+
46
+
Async::HTTP::Internet.instance.post("https://example.com", body, interim_response: interim_response) do |response|
0 commit comments