Skip to content

Commit

Permalink
http: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zenith391 committed Apr 22, 2023
1 parent 8e88af1 commit 8cc0184
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/http.zig
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ pub usingnamespace if (@hasDecl(backend, "Http")) struct {
client.* = .{ .allocator = internal.lasting_allocator };

const uri = try std.Uri.parse(self.url);
var headers = std.http.Client.Request.Headers{
.connection = .close,
};
var request = try client.request(uri, headers, .{});
// try request.finish();
var headers = std.http.Headers{ .allocator = internal.lasting_allocator };
try headers.append("Connection", "close");
var request = try client.request(.GET, uri, headers, .{});
try request.start();
return HttpResponse{ .request = request, .client = client };
}
};
Expand All @@ -80,7 +79,7 @@ pub usingnamespace if (@hasDecl(backend, "Http")) struct {
pub const Reader = std.io.Reader(*HttpResponse, ReadError, read);

pub fn isReady(self: *HttpResponse) bool {
_ = self;
self.request.do() catch return true;
return true;
}

Expand Down

0 comments on commit 8cc0184

Please sign in to comment.