We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb53d25 commit 92c1447Copy full SHA for 92c1447
libraries/common/io/requests.effekt
@@ -533,6 +533,17 @@ namespace plain {
533
}
534
535
536
+
537
+ /// Implements the `request` function using an implementation in Effekt.
538
+ /// `read`s and `emit`s from/to a connection (provided from elsewhere).
539
+ def request[R]{ body: => Unit / RequestBuilder }{ res: {ResponseReader} => R }: R / { emit[Byte], read[Byte], Exception[RequestError] } = {
540
+ constructRequest{ body }
541
+ try {
542
+ parseResponse{res}
543
+ } with Exception[WrongFormat] {
544
+ def raise(e, msg) = do raise(RequestError(), "Malformed response: " ++ msg)
545
+ }
546
547
548
549
0 commit comments