| ... | @@ -820,7 +820,7 @@ pub const Request = struct { | ... | @@ -820,7 +820,7 @@ pub const Request = struct { |
| 820 | /// Sends and flushes a complete request as only HTTP head, no body. | 820 | /// Sends and flushes a complete request as only HTTP head, no body. |
| 821 | pub fn sendBodiless(r: *Request) std.io.Writer.Error!void { | 821 | pub fn sendBodiless(r: *Request) std.io.Writer.Error!void { |
| 822 | try sendBodilessUnflushed(r); | 822 | try sendBodilessUnflushed(r); |
| 823 | try r.connection.?.writer.flush(); | 823 | try r.connection.?.flush(); |
| 824 | } | 824 | } |
| 825 | | 825 | |
| 826 | /// Sends but does not flush a complete request as only HTTP head, no body. | 826 | /// Sends but does not flush a complete request as only HTTP head, no body. |
| ... | @@ -830,9 +830,22 @@ pub const Request = struct { | ... | @@ -830,9 +830,22 @@ pub const Request = struct { |
| 830 | try sendHead(r); | 830 | try sendHead(r); |
| 831 | } | 831 | } |
| 832 | | 832 | |
| | 833 | /// Transfers the HTTP head over the connection and flushes. |
| | 834 | /// |
| | 835 | /// See also: |
| | 836 | /// * `sendBodyUnflushed` |
| | 837 | pub fn sendBody(r: *Request) std.io.Writer.Error!http.BodyWriter { |
| | 838 | const result = try sendBodyUnflushed(r); |
| | 839 | try r.connection.?.flush(); |
| | 840 | return result; |
| | 841 | } |
| | 842 | |
| 833 | /// Transfers the HTTP head over the connection, which is not flushed until | 843 | /// Transfers the HTTP head over the connection, which is not flushed until |
| 834 | /// `BodyWriter.flush` or `BodyWriter.end` is called. | 844 | /// `BodyWriter.flush` or `BodyWriter.end` is called. |
| 835 | pub fn sendBody(r: *Request) std.io.Writer.Error!http.BodyWriter { | 845 | /// |
| | 846 | /// See also: |
| | 847 | /// * `sendBody` |
| | 848 | pub fn sendBodyUnflushed(r: *Request) std.io.Writer.Error!http.BodyWriter { |
| 836 | assert(r.method.requestHasBody()); | 849 | assert(r.method.requestHasBody()); |
| 837 | try sendHead(r); | 850 | try sendHead(r); |
| 838 | return .{ | 851 | return .{ |