{"id":23876494,"url":"https://github.com/linxmouse/qrhttpclient","last_synced_at":"2026-04-22T05:33:09.929Z","repository":{"id":270661929,"uuid":"911072239","full_name":"linxmouse/QRHttpClient","owner":"linxmouse","description":"This library provides a simple way to make HTTP requests and handle JSON responses with automatic serialization/deserialization.","archived":false,"fork":false,"pushed_at":"2025-01-02T07:26:58.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T21:23:53.534Z","etag":null,"topics":["json-parser","qt","rest-api"],"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/linxmouse.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-02T07:16:59.000Z","updated_at":"2025-01-02T07:27:01.000Z","dependencies_parsed_at":"2025-01-02T08:28:17.189Z","dependency_job_id":"5c7cd175-5013-460a-a1cd-d206c8494c0e","html_url":"https://github.com/linxmouse/QRHttpClient","commit_stats":null,"previous_names":["linxmouse/qrhttpclient"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linxmouse/QRHttpClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxmouse%2FQRHttpClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxmouse%2FQRHttpClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxmouse%2FQRHttpClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxmouse%2FQRHttpClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linxmouse","download_url":"https://codeload.github.com/linxmouse/QRHttpClient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linxmouse%2FQRHttpClient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32122724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["json-parser","qt","rest-api"],"created_at":"2025-01-03T19:20:01.528Z","updated_at":"2026-04-22T05:33:09.908Z","avatar_url":"https://github.com/linxmouse.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QRHttpClient\n\nA modern, lightweight HTTP client library for Qt applications with JSON serialization support. This library provides a simple way to make HTTP requests and handle JSON responses with automatic serialization/deserialization.\n\n## Features\n\n- Support for common HTTP methods (GET, POST, PUT, DELETE)\n- Automatic JSON serialization/deserialization\n- Type-safe JSON property handling\n- Support for query string parameters\n- Custom logger implementation\n- Comprehensive error handling\n- Template-based serialization for STL and Qt containers\n\n## Dependencies\n\n- Qt 5.x (Core and Network modules)\n- C++11 or later\n- CMake 3.10 or later\n\n## Building the Project\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n## Usage\n\n### Basic HTTP Request\n\n```cpp\n// Make a simple GET request\nQString url = \"http://api.example.com/data\";\nIResult result = httpClient-\u003eGet(url);\n\nif (result.code() == 0) {\n    // Handle successful response\n    qDebug() \u003c\u003c result.data();\n} else {\n    qCritical() \u003c\u003c result.message();\n}\n```\n\n### Working with Query Parameters\n\n```cpp\n// Using QJsonObject for query parameters\nQString baseUrl = \"http://api.example.com/endpoint\";\nQJsonObject params{{\"param1\", \"value1\"}, {\"param2\", \"value2\"}};\nQUrl url = httpClient-\u003ecreateWithQuerystring(baseUrl, params);\n\n// Using QMap for query parameters\nQMap\u003cQString, QString\u003e queryParams;\nqueryParams[\"param1\"] = \"value1\";\nqueryParams[\"param2\"] = \"value2\";\nQUrl url = httpClient-\u003ecreateWithQuerystring(baseUrl, queryParams);\n```\n\n### JSON Serialization\n\nDefine your data model:\n\n```cpp\nclass MyModel : public JsonSerializable\n{\n    Q_GADGET\n    JSON_SERIALIZABLE\npublic:\n    JSON_PROPERTY(QString, name)\n    JSON_PROPERTY(int, age)\n    JSON_PROPERTY(QList\u003cQString\u003e, tags)\n};\n```\n\nUse the model:\n\n```cpp\nMyModel model;\nmodel.set_name(\"John\");\nmodel.set_age(30);\n\n// Serialize to JSON\nQJsonObject json = model.toJson();\nQByteArray rawJson = model.toRawJson();\n\n// Deserialize from JSON\nMyModel newModel;\nnewModel.fromJson(jsonData);\n```\n\n## Logger Configuration\n\nThe project includes a custom logger (TyLogger) that:\n\n- Writes logs to daily rotating files\n- Supports different log levels (DEBUG, INFO, WARN, ERROR, FATAL)\n- Includes timestamps and source file information in debug builds\n- Thread-safe implementation\n- Asynchronous file writing\n\nTo use the logger:\n\n```cpp\n// Install the custom message handler\nqInstallMessageHandler(TyLogger::customMessageHandler);\n\n// Use Qt's logging macros\nqDebug() \u003c\u003c \"Debug message\";\nqInfo() \u003c\u003c \"Info message\";\nqWarning() \u003c\u003c \"Warning message\";\nqCritical() \u003c\u003c \"Critical error\";\n```\n\n## Design Patterns\n\nThe library implements several design patterns:\n\n- Singleton pattern for HTTP client and logger\n- Template method pattern for serialization\n- CRTP (Curiously Recurring Template Pattern) for JSON serialization\n- Observer pattern for network replies\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- Thanks to Qt framework for providing excellent networking capabilities\n- Inspired by modern C++ design patterns and best practices\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinxmouse%2Fqrhttpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinxmouse%2Fqrhttpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinxmouse%2Fqrhttpclient/lists"}