{"id":13626682,"url":"https://github.com/ducdetronquito/requestz","last_synced_at":"2025-04-16T15:31:26.397Z","repository":{"id":43760628,"uuid":"277799670","full_name":"ducdetronquito/requestz","owner":"ducdetronquito","description":"HTTP client for Zig 🦎","archived":true,"fork":false,"pushed_at":"2023-01-11T12:29:42.000Z","size":40,"stargazers_count":115,"open_issues_count":5,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-02T22:27:34.344Z","etag":null,"topics":["http","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducdetronquito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T11:37:34.000Z","updated_at":"2024-05-22T16:04:28.000Z","dependencies_parsed_at":"2023-02-09T03:01:22.481Z","dependency_job_id":null,"html_url":"https://github.com/ducdetronquito/requestz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdetronquito%2Frequestz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdetronquito%2Frequestz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdetronquito%2Frequestz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducdetronquito%2Frequestz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducdetronquito","download_url":"https://codeload.github.com/ducdetronquito/requestz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223716683,"owners_count":17191091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http","zig"],"created_at":"2024-08-01T21:02:26.426Z","updated_at":"2024-11-08T16:31:23.333Z","avatar_url":"https://github.com/ducdetronquito.png","language":"Zig","funding_links":[],"categories":["Zig"],"sub_categories":[],"readme":"# Requestz\n\nAn HTTP client inspired by [httpx](https://github.com/encode/httpx) and [ureq](https://github.com/algesten/ureq).\n\n[![Build Status](https://api.travis-ci.org/ducdetronquito/requestz.svg?branch=master)](https://travis-ci.org/ducdetronquito/requestz) [![License](https://img.shields.io/badge/License-BSD%200--Clause-ff69b4.svg)](https://github.com/ducdetronquito/requestz#license) [![Requirements](https://img.shields.io/badge/zig-master_(19.08.2021)-orange)](https://ziglang.org/)\n\n⚠️ I'm currently renovating an old house which does not allow me to work on [requestz](https://github.com/ducdetronquito/requestz/), [h11](https://github.com/ducdetronquito/h11/) and [http](https://github.com/ducdetronquito/http) anymore. Feel free to fork or borrow some ideas if there are any good ones :)\n\n## Installation\n\n*requestz* is available on [astrolabe.pm](https://astrolabe.pm/) via [gyro](https://github.com/mattnite/gyro)\n\n```\ngyro add ducdetronquito/requestz\n```\n\n## Usage\n\nSend a GET request\n```zig\nconst client = @import(\"requestz.zig\").Client;\n\nvar client = try Client.init(std.testing.allocator);\ndefer client.deinit();\n\nvar response = try client.get(\"http://httpbin.org/get\", .{});\ndefer response.deinit();\n```\n\nSend a request with headers\n```zig\nconst Headers = @import(\"http\").Headers;\n\nvar headers = Headers.init(std.testing.allocator);\ndefer headers.deinit();\ntry headers.append(\"Gotta-go\", \"Fast!\");\n\nvar response = try client.get(\"http://httpbin.org/get\", .{ .headers = headers.items() });\ndefer response.deinit();\n```\n\nSend a request with compile-time headers\n```zig\nvar headers = .{\n    .{\"Gotta-go\", \"Fast!\"}\n};\n\nvar response = try client.get(\"http://httpbin.org/get\", .{ .headers = headers });\ndefer response.deinit();\n```\n\nSend binary data along with a POST request\n```zig\nvar response = try client.post(\"http://httpbin.org/post\", .{ .content = \"Gotta go fast!\" });\ndefer response.deinit();\n\nvar tree = try response.json();\ndefer tree.deinit();\n```\n\nStream a response\n```zig\nvar response = try client.stream(.Get, \"http://httpbin.org/\", .{});\ndefer response.deinit();\n\nwhile(true) {\n    var buffer: [4096]u8 = undefined;\n    var bytesRead = try response.read(\u0026buffer);\n    if (bytesRead == 0) {\n        break;\n    }\n    std.debug.print(\"{}\", .{buffer[0..bytesRead]});\n}\n```\n\nOther standard HTTP method shortcuts:\n- `client.connect`\n- `client.delete`\n- `client.head`\n- `client.options`\n- `client.patch`\n- `client.put`\n- `client.trace`\n\n## Dependencies\n\n- [h11](https://github.com/ducdetronquito/h11)\n- [http](https://github.com/ducdetronquito/http)\n- [iguanaTLS](https://github.com/alexnask/iguanaTLS)\n- [zig-network](https://github.com/MasterQ32/zig-network)\n\n## License\n\n*requestz* is released under the [BSD Zero clause license](https://choosealicense.com/licenses/0bsd/). 🎉🍻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdetronquito%2Frequestz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducdetronquito%2Frequestz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducdetronquito%2Frequestz/lists"}