mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Merge pull request #24926 from mrjbq7/http-fetch
http.Client: don't forget to flush
This commit is contained in:
parent
306176046e
commit
47a2f2ddae
@ -1797,9 +1797,10 @@ pub fn fetch(client: *Client, options: FetchOptions) FetchError!FetchResult {
|
||||
|
||||
if (options.payload) |payload| {
|
||||
req.transfer_encoding = .{ .content_length = payload.len };
|
||||
var body = try req.sendBody(&.{});
|
||||
var body = try req.sendBodyUnflushed(&.{});
|
||||
try body.writer.writeAll(payload);
|
||||
try body.end();
|
||||
try req.connection.?.flush();
|
||||
} else {
|
||||
try req.sendBodiless();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user