{"id":18035804,"url":"https://github.com/echo-devim/nicehttp","last_synced_at":"2026-02-03T06:03:05.891Z","repository":{"id":258627386,"uuid":"870754550","full_name":"echo-devim/nicehttp","owner":"echo-devim","description":"Small HTTP REST API client/server framework in C++23","archived":false,"fork":false,"pushed_at":"2024-10-24T06:35:43.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T23:08:33.090Z","etag":null,"topics":["client","cpp","cpp23","http","rest-api","server"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/echo-devim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-10-10T15:53:11.000Z","updated_at":"2024-12-06T09:34:32.000Z","dependencies_parsed_at":"2024-12-18T04:12:02.744Z","dependency_job_id":"d8ac7d26-14a2-43a5-9403-b09b798b40d8","html_url":"https://github.com/echo-devim/nicehttp","commit_stats":null,"previous_names":["echo-devim/nicehttp"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/echo-devim/nicehttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echo-devim%2Fnicehttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echo-devim%2Fnicehttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echo-devim%2Fnicehttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echo-devim%2Fnicehttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/echo-devim","download_url":"https://codeload.github.com/echo-devim/nicehttp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/echo-devim%2Fnicehttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29035256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T02:28:16.591Z","status":"ssl_error","status_checked_at":"2026-02-03T02:27:48.904Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["client","cpp","cpp23","http","rest-api","server"],"created_at":"2024-10-30T12:10:19.707Z","updated_at":"2026-02-03T06:03:05.875Z","avatar_url":"https://github.com/echo-devim.png","language":"C++","readme":"# NiceHTTP\n\nSmall cross-platform HTTP REST API client/server framework written as an exercise to learn modern C++23.\n\nThe framework supports only HTTP 1.1 and can be used to deploy simple rest api services.\n\nThis project is made for inter-communication among applications using HTTP protocol. The code is very simple and hackable, thus you can customize it for your needs.\n\nFeatures:\n- Cross-Platform (supports Linux/Windows)\n- Supports only HTTP/1.1 protocol\n- Supports authentication\n- Server multi-threaded\n- single file header to include\n- very easy and fast\n- designed to exchange json messages\n\n## Server example\n\n```c++\n//handle /test/\u003cint\u003e endpoint\nhttp::Response handle_test(const http::Request \u0026req) {\n    // here you can parse the request, including parameters\n    cout \u003c\u003c \"Requested uri: \" \u003c\u003c req.uri \u003c\u003c endl;\n    for (const auto\u0026 p : const_cast\u003chttp::Request\u0026\u003e(req).getParams()) {\n        std::cout \u003c\u003c \"key '\" \u003c\u003c p.first \u003c\u003c \"' has value '\" \u003c\u003c p.second \u003c\u003c \"'\" \u003c\u003c std::endl;\n    }\n    // generate response\n    map\u003cstring,string\u003e headers;\n    string body = \"{\\\"status\\\": \\\"OK\\\"}\";\n    http::Response resp {200, \"OK\", PROTO_HTTP1, headers, true, body.length(), body};\n    return resp;\n}\n\nvoid main() {\n    NiceHTTP nhttp;\n    // Route supports regex\n    Route r {\"GET\", \"/test/[0-9]\", handle_test, \"apptoken123\"};\n    nhttp.getRouter().add(r);\n    nhttp.start(\"127.0.0.1\", 8090);\n}\n```\n\n## Client example\n```c++\nvoid main() {\n    NiceHTTP nhttp;\n    map\u003cstring,string\u003e headers;\n    // Add auth app token\n    headers.insert({\"Authorization\", \"apptoken123\"});\n    http::Request req {\"GET\", \"/test/2?id=45\u0026user=admin\", PROTO_HTTP1, headers, false, 0, \"\"};\n    http::Response r;\n    r = nhttp.request(req, \"localhost\", 8090);\n    cout \u003c\u003c r.toString(false) \u003c\u003c endl;\n}\n```\n\n# Compile\n\nUse the following commands to compile the project for Linux.\n\nDemo server compilation:\n```sh\ng++ -D server -D NICEHTTP_VERBOSE -std=c++23 -o nhttpsrv main.cpp\n```\nDemo client compilation:\n```sh\ng++ -D client -std=c++23 -o nhttpcl main.cpp\n```\n\nUse the following commands to compile the project for Windows.\n\nDemo server compilation:\n```sh\nx86_64-w64-mingw32-g++ -D server -D NICEHTTP_VERBOSE -std=c++23 -static -fno-rtti -o nhttpsrv.exe main.cpp -lws2_32\n```\n\nDemo client compilation:\n```sh\nx86_64-w64-mingw32-g++ -D client -std=c++23 -static -fno-rtti -o nhttpcl.exe main.cpp -lws2_32\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecho-devim%2Fnicehttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecho-devim%2Fnicehttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecho-devim%2Fnicehttp/lists"}