{"id":15366826,"url":"https://github.com/erkkah/naett","last_synced_at":"2025-04-14T03:34:03.061Z","repository":{"id":44932714,"uuid":"426326232","full_name":"erkkah/naett","owner":"erkkah","description":"Tiny cross-platform HTTP / HTTPS client library in C.","archived":false,"fork":false,"pushed_at":"2024-04-13T18:52:23.000Z","size":144,"stargazers_count":107,"open_issues_count":3,"forks_count":15,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-27T17:35:58.812Z","etag":null,"topics":["android","c","cross-platform","http","http-client","https","ios","linux","macos","portable","tiny-library","windows"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erkkah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-09T17:36:59.000Z","updated_at":"2025-03-20T19:19:36.000Z","dependencies_parsed_at":"2024-10-16T08:40:51.304Z","dependency_job_id":"9b880efb-8311-48dc-b85c-dcd9bb51c9ab","html_url":"https://github.com/erkkah/naett","commit_stats":{"total_commits":107,"total_committers":4,"mean_commits":26.75,"dds":"0.16822429906542058","last_synced_commit":"5f695cfa9fcbf30668a4d3ac4b4abf1cd89a1302"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fnaett","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fnaett/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fnaett/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fnaett/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkkah","download_url":"https://codeload.github.com/erkkah/naett/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248815687,"owners_count":21165966,"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":["android","c","cross-platform","http","http-client","https","ios","linux","macos","portable","tiny-library","windows"],"created_at":"2024-10-01T13:19:56.501Z","updated_at":"2025-04-14T03:34:03.028Z","avatar_url":"https://github.com/erkkah.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# naett /nɛt:/\n\nTiny HTTP client library in C.\n\nWraps native HTTP client functionality on macOS, Windows, Linux, iOS and Android in a single, simple non-blocking API.\n\n## Using `naett`\n\nGet the `naett.c` and `naett.h` files and throw them into your project. Check out the [example](./example) for a basic `Makefile` - based setup.\n\nThe library needs to be initialized by a call to `naettInit()`. On Android, you need to provide a `JavaVM*` handle in the call to `naettInit()`.\nOn the other platforms, call with `NULL`.\n\nSee `naett.h` for reference docs.\n\n## Platform implementations\n\n`naett` uses the following HTTP client libraries on each platform:\n\n| Platform | Library / component | Build with |\n| --- | --- | --- |\n| macOS, iOS | NSURLRequest | -framework Foundation |\n| Windows | WinHTTP Sessions | -lwinhttp |\n| Android | java.net.URL | NDK |\n| Linux | libcurl | -lcurl -lpthread |\n\n### Example\n\n```C\n#include \"naett.h\"\n#include \u003cunistd.h\u003e\n#include \u003cstdio.h\u003e\n\nint main(int argc, char** argv) {\n    naettInit(NULL);\n\n    naettReq* req =\n        naettRequest(\"https://foo.site.net\", naettMethod(\"GET\"), naettHeader(\"accept\", \"application/json\"));\n\n    naettRes* res = naettMake(req);\n\n    while (!naettComplete(res)) {\n        usleep(100 * 1000);\n    }\n\n    if (naettGetStatus(res) \u003c 0) {\n        printf(\"Request failed\\n\");\n        return 1;\n    }\n\n    int bodyLength = 0;\n    const char* body = naettGetBody(res, \u0026bodyLength);\n\n    printf(\"Got %d bytes of type '%s':\\n\", bodyLength, naettGetHeader(res, \"Content-Type\"));\n    printf(\"%.100s\\n...\\n\", body);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Fnaett","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkkah%2Fnaett","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Fnaett/lists"}