I am very new to zig, I was trying to make a simple http request to get a json.
Here is a snippet of the code:
const uri = try std.Uri.parse(url);
const response = try client.fetch(.{ .method = .GET, .location = .{ .uri = uri }, .extra_headers = headers, .response_writer = writer });
if I provide a valid url without spaces, the request returns successfully, but if I provide something like ?search=hello world it fails. I was hoping it would encode the url properly before sending.
I could of course do it myself before parsing it, but I was hoping there would be a better way to do it.
Please be kind, these have been my first 6 hours using the language. 😄