File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public struct Body<Bytes: Parser>: Parser where Bytes.Input == Data {
20
20
/// var message: String
21
21
/// }
22
22
///
23
- /// Body(.data. json(Comment.self))
23
+ /// Body(.json(Comment.self))
24
24
/// ```
25
25
///
26
26
/// - Parameter bytesConversion: A conversion that transforms bytes into some other type.
@@ -30,6 +30,12 @@ public struct Body<Bytes: Parser>: Parser where Bytes.Input == Data {
30
30
self . bytesParser = Rest ( ) . replaceError ( with: . init( ) ) . map ( bytesConversion)
31
31
}
32
32
33
+ /// Initializes a body parser that parses the body as data in its entirety.
34
+ @inlinable
35
+ public init ( ) where Bytes == Parsers . ReplaceError < Rest < Bytes . Input > > {
36
+ self . bytesParser = Rest ( ) . replaceError ( with: . init( ) )
37
+ }
38
+
33
39
@inlinable
34
40
public func parse( _ input: inout URLRequestData ) throws -> Bytes . Output {
35
41
guard var body = input. body
You can’t perform that action at this time.
0 commit comments