| ... | @@ -240,7 +240,7 @@ pub fn main() !void { | ... | @@ -240,7 +240,7 @@ pub fn main() !void { |
| 240 | var req = try client.request(.GET, uri, h, .{}); | 240 | var req = try client.request(.GET, uri, h, .{}); |
| 241 | defer req.deinit(); | 241 | defer req.deinit(); |
| 242 | | 242 | |
| 243 | try req.start(); | 243 | try req.start(.{}); |
| 244 | try req.wait(); | 244 | try req.wait(); |
| 245 | | 245 | |
| 246 | const body = try req.reader().readAllAlloc(calloc, 8192); | 246 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -265,7 +265,7 @@ pub fn main() !void { | ... | @@ -265,7 +265,7 @@ pub fn main() !void { |
| 265 | var req = try client.request(.GET, uri, h, .{}); | 265 | var req = try client.request(.GET, uri, h, .{}); |
| 266 | defer req.deinit(); | 266 | defer req.deinit(); |
| 267 | | 267 | |
| 268 | try req.start(); | 268 | try req.start(.{}); |
| 269 | try req.wait(); | 269 | try req.wait(); |
| 270 | | 270 | |
| 271 | const body = try req.reader().readAllAlloc(calloc, 8192 * 1024); | 271 | const body = try req.reader().readAllAlloc(calloc, 8192 * 1024); |
| ... | @@ -289,7 +289,7 @@ pub fn main() !void { | ... | @@ -289,7 +289,7 @@ pub fn main() !void { |
| 289 | var req = try client.request(.HEAD, uri, h, .{}); | 289 | var req = try client.request(.HEAD, uri, h, .{}); |
| 290 | defer req.deinit(); | 290 | defer req.deinit(); |
| 291 | | 291 | |
| 292 | try req.start(); | 292 | try req.start(.{}); |
| 293 | try req.wait(); | 293 | try req.wait(); |
| 294 | | 294 | |
| 295 | const body = try req.reader().readAllAlloc(calloc, 8192); | 295 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -315,7 +315,7 @@ pub fn main() !void { | ... | @@ -315,7 +315,7 @@ pub fn main() !void { |
| 315 | var req = try client.request(.GET, uri, h, .{}); | 315 | var req = try client.request(.GET, uri, h, .{}); |
| 316 | defer req.deinit(); | 316 | defer req.deinit(); |
| 317 | | 317 | |
| 318 | try req.start(); | 318 | try req.start(.{}); |
| 319 | try req.wait(); | 319 | try req.wait(); |
| 320 | | 320 | |
| 321 | const body = try req.reader().readAllAlloc(calloc, 8192); | 321 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -340,7 +340,7 @@ pub fn main() !void { | ... | @@ -340,7 +340,7 @@ pub fn main() !void { |
| 340 | var req = try client.request(.HEAD, uri, h, .{}); | 340 | var req = try client.request(.HEAD, uri, h, .{}); |
| 341 | defer req.deinit(); | 341 | defer req.deinit(); |
| 342 | | 342 | |
| 343 | try req.start(); | 343 | try req.start(.{}); |
| 344 | try req.wait(); | 344 | try req.wait(); |
| 345 | | 345 | |
| 346 | const body = try req.reader().readAllAlloc(calloc, 8192); | 346 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -366,7 +366,7 @@ pub fn main() !void { | ... | @@ -366,7 +366,7 @@ pub fn main() !void { |
| 366 | var req = try client.request(.GET, uri, h, .{}); | 366 | var req = try client.request(.GET, uri, h, .{}); |
| 367 | defer req.deinit(); | 367 | defer req.deinit(); |
| 368 | | 368 | |
| 369 | try req.start(); | 369 | try req.start(.{}); |
| 370 | try req.wait(); | 370 | try req.wait(); |
| 371 | | 371 | |
| 372 | const body = try req.reader().readAllAlloc(calloc, 8192); | 372 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -395,7 +395,7 @@ pub fn main() !void { | ... | @@ -395,7 +395,7 @@ pub fn main() !void { |
| 395 | | 395 | |
| 396 | req.transfer_encoding = .{ .content_length = 14 }; | 396 | req.transfer_encoding = .{ .content_length = 14 }; |
| 397 | | 397 | |
| 398 | try req.start(); | 398 | try req.start(.{}); |
| 399 | try req.writeAll("Hello, "); | 399 | try req.writeAll("Hello, "); |
| 400 | try req.writeAll("World!\n"); | 400 | try req.writeAll("World!\n"); |
| 401 | try req.finish(); | 401 | try req.finish(); |
| ... | @@ -425,7 +425,7 @@ pub fn main() !void { | ... | @@ -425,7 +425,7 @@ pub fn main() !void { |
| 425 | var req = try client.request(.GET, uri, h, .{}); | 425 | var req = try client.request(.GET, uri, h, .{}); |
| 426 | defer req.deinit(); | 426 | defer req.deinit(); |
| 427 | | 427 | |
| 428 | try req.start(); | 428 | try req.start(.{}); |
| 429 | try req.wait(); | 429 | try req.wait(); |
| 430 | | 430 | |
| 431 | const body = try req.reader().readAllAlloc(calloc, 8192); | 431 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -454,7 +454,7 @@ pub fn main() !void { | ... | @@ -454,7 +454,7 @@ pub fn main() !void { |
| 454 | | 454 | |
| 455 | req.transfer_encoding = .chunked; | 455 | req.transfer_encoding = .chunked; |
| 456 | | 456 | |
| 457 | try req.start(); | 457 | try req.start(.{}); |
| 458 | try req.writeAll("Hello, "); | 458 | try req.writeAll("Hello, "); |
| 459 | try req.writeAll("World!\n"); | 459 | try req.writeAll("World!\n"); |
| 460 | try req.finish(); | 460 | try req.finish(); |
| ... | @@ -482,7 +482,7 @@ pub fn main() !void { | ... | @@ -482,7 +482,7 @@ pub fn main() !void { |
| 482 | var req = try client.request(.GET, uri, h, .{}); | 482 | var req = try client.request(.GET, uri, h, .{}); |
| 483 | defer req.deinit(); | 483 | defer req.deinit(); |
| 484 | | 484 | |
| 485 | try req.start(); | 485 | try req.start(.{}); |
| 486 | try req.wait(); | 486 | try req.wait(); |
| 487 | | 487 | |
| 488 | const body = try req.reader().readAllAlloc(calloc, 8192); | 488 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -506,7 +506,7 @@ pub fn main() !void { | ... | @@ -506,7 +506,7 @@ pub fn main() !void { |
| 506 | var req = try client.request(.GET, uri, h, .{}); | 506 | var req = try client.request(.GET, uri, h, .{}); |
| 507 | defer req.deinit(); | 507 | defer req.deinit(); |
| 508 | | 508 | |
| 509 | try req.start(); | 509 | try req.start(.{}); |
| 510 | try req.wait(); | 510 | try req.wait(); |
| 511 | | 511 | |
| 512 | const body = try req.reader().readAllAlloc(calloc, 8192); | 512 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -530,7 +530,7 @@ pub fn main() !void { | ... | @@ -530,7 +530,7 @@ pub fn main() !void { |
| 530 | var req = try client.request(.GET, uri, h, .{}); | 530 | var req = try client.request(.GET, uri, h, .{}); |
| 531 | defer req.deinit(); | 531 | defer req.deinit(); |
| 532 | | 532 | |
| 533 | try req.start(); | 533 | try req.start(.{}); |
| 534 | try req.wait(); | 534 | try req.wait(); |
| 535 | | 535 | |
| 536 | const body = try req.reader().readAllAlloc(calloc, 8192); | 536 | const body = try req.reader().readAllAlloc(calloc, 8192); |
| ... | @@ -554,7 +554,7 @@ pub fn main() !void { | ... | @@ -554,7 +554,7 @@ pub fn main() !void { |
| 554 | var req = try client.request(.GET, uri, h, .{}); | 554 | var req = try client.request(.GET, uri, h, .{}); |
| 555 | defer req.deinit(); | 555 | defer req.deinit(); |
| 556 | | 556 | |
| 557 | try req.start(); | 557 | try req.start(.{}); |
| 558 | req.wait() catch |err| switch (err) { | 558 | req.wait() catch |err| switch (err) { |
| 559 | error.TooManyHttpRedirects => {}, | 559 | error.TooManyHttpRedirects => {}, |
| 560 | else => return err, | 560 | else => return err, |
| ... | @@ -576,7 +576,7 @@ pub fn main() !void { | ... | @@ -576,7 +576,7 @@ pub fn main() !void { |
| 576 | var req = try client.request(.GET, uri, h, .{}); | 576 | var req = try client.request(.GET, uri, h, .{}); |
| 577 | defer req.deinit(); | 577 | defer req.deinit(); |
| 578 | | 578 | |
| 579 | try req.start(); | 579 | try req.start(.{}); |
| 580 | const result = req.wait(); | 580 | const result = req.wait(); |
| 581 | | 581 | |
| 582 | try testing.expectError(error.ConnectionRefused, result); // expects not segfault but the regular error | 582 | try testing.expectError(error.ConnectionRefused, result); // expects not segfault but the regular error |
| ... | @@ -623,7 +623,7 @@ pub fn main() !void { | ... | @@ -623,7 +623,7 @@ pub fn main() !void { |
| 623 | | 623 | |
| 624 | req.transfer_encoding = .chunked; | 624 | req.transfer_encoding = .chunked; |
| 625 | | 625 | |
| 626 | try req.start(); | 626 | try req.start(.{}); |
| 627 | try req.wait(); | 627 | try req.wait(); |
| 628 | try testing.expectEqual(http.Status.@"continue", req.response.status); | 628 | try testing.expectEqual(http.Status.@"continue", req.response.status); |
| 629 | | 629 | |
| ... | @@ -657,7 +657,7 @@ pub fn main() !void { | ... | @@ -657,7 +657,7 @@ pub fn main() !void { |
| 657 | | 657 | |
| 658 | req.transfer_encoding = .chunked; | 658 | req.transfer_encoding = .chunked; |
| 659 | | 659 | |
| 660 | try req.start(); | 660 | try req.start(.{}); |
| 661 | try req.wait(); | 661 | try req.wait(); |
| 662 | try testing.expectEqual(http.Status.expectation_failed, req.response.status); | 662 | try testing.expectEqual(http.Status.expectation_failed, req.response.status); |
| 663 | } | 663 | } |