File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub fn main() !void {
1717 .extra_headers = &.{
1818 .{
1919 .name = "cookie" ,
20- .value = "***REMOVED*** " ,
20+ .value = "session=53616c7465645f5f51bb2753ea90c02364db584f31a2b53d145fd73852e0eab2df9622cfc4298efcbadb42cb1561c5c04aea2197808df1573cd9bd6f39f0a564 " ,
2121 },
2222 },
2323 .method = .GET ,
Original file line number Diff line number Diff line change 1+ const std = @import ("std" );
2+
3+ const Client = std .http .Client ;
4+
5+ pub fn main () ! void {
6+ const allocator = std .heap .page_allocator ;
7+
8+ var response : std.Io.Writer.Allocating = .init (allocator );
9+ defer response .deinit ();
10+
11+ var client : Client = .{
12+ .allocator = allocator ,
13+ };
14+ defer client .deinit ();
15+
16+ _ = try client .fetch (.{
17+ .method = .POST ,
18+ .location = .{
19+ .url = "https://echo.free.beeceptor.com" ,
20+ },
21+ .payload = "Hello World" ,
22+ .response_writer = & response .writer ,
23+ });
24+
25+ const response_data = try response .toOwnedSlice ();
26+ std .debug .print ("{s}\n " , .{response_data });
27+ }
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub fn main() !void {
1818 .extra_headers = &.{
1919 .{
2020 .name = "cookie" ,
21- .value = "***REMOVED*** " ,
21+ .value = "session=53616c7465645f5f51bb2753ea90c02364db584f31a2b53d145fd73852e0eab2df9622cfc4298efcbadb42cb1561c5c04aea2197808df1573cd9bd6f39f0a564 " ,
2222 },
2323 },
2424 .method = .GET ,
You can’t perform that action at this time.
0 commit comments