{"id":19156987,"url":"https://github.com/bertrandmartel/http-streaming-decoder","last_synced_at":"2025-06-10T11:04:52.258Z","repository":{"id":31821495,"uuid":"35388338","full_name":"bertrandmartel/http-streaming-decoder","owner":"bertrandmartel","description":"C++ HTTP streaming decoder library for Qt4/Qt5","archived":false,"fork":false,"pushed_at":"2016-12-25T23:44:57.000Z","size":1104,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-03T20:12:25.773Z","etag":null,"topics":[],"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/bertrandmartel.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}},"created_at":"2015-05-10T21:15:10.000Z","updated_at":"2023-01-17T07:56:55.000Z","dependencies_parsed_at":"2022-08-17T19:00:52.488Z","dependency_job_id":null,"html_url":"https://github.com/bertrandmartel/http-streaming-decoder","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fhttp-streaming-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fhttp-streaming-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fhttp-streaming-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fhttp-streaming-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertrandmartel","download_url":"https://codeload.github.com/bertrandmartel/http-streaming-decoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240241803,"owners_count":19770463,"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":[],"created_at":"2024-11-09T08:36:50.059Z","updated_at":"2025-02-22T21:43:23.224Z","avatar_url":"https://github.com/bertrandmartel.png","language":"C++","readme":"# HTTP streaming decoder library#\n\n[![Build Status](https://travis-ci.org/bertrandmartel/http-streaming-decoder.svg?branch=master)](https://travis-ci.org/bertrandmartel/http-streaming-decoder)\n[![License](http://img.shields.io/:license-mit-blue.svg)](LICENSE.md)\n\nhttp://bertrandmartel.github.io/http-streaming-decoder\n\nC++ HTTP streaming decoder library for Qt4/Qt5\n\n* parse HTTP data streaming\n* non-blocking process\n* compatible with non-blocking or blocking socket architecture\n\n## Usage\n\nInstantiate `httpdecoder` \u0026 `httpconsumer` objects :\n\n```\n#include \"protocol/http/httpdecoder.h\"\n#include \"protocol/inter/http/httpconsumer.h\"\n\n....\n\nhttpdecoder decoder;\nhttpconsumer *consumer = new httpconsumer;\n```\n\n* `httpconsumer` will monitor your data streaming decoding and will contain decoded frame(s)\n\nDecode a `QByteArray*` http stream :\n\n```\nQByteArray *httpframe = new QByteArray(\"POST /rest/help/todo HTTP/1.1\\r\\n\"\n                                       \"headers1:  value1\\r\\n\"\n                                       \"headers2:  value2\\r\\n\"\n                                       \"Content-Length:  15\\r\\n\\r\\n\"\n                                       \"bodyTobeWritten\\r\\n\");\n\ndecoder.httpdecode(consumer, httpFrame);\n```\n\nFrom consumer object `consumer-\u003egetHttpFrameList()` you can extract those fields : \n\n|  method name       | return data type                  |  description  |  example                |\n| -------------------| ----------------------------------|---------------|-------------------------|\n| `getUri()`         | `std::string`                       | http uri           |  \"/api/rest\"              |\n| `getMethod()`      | `std::string`                       | http method        |  \"POST\"                   |\n| `getBody()`        | `std::string`                       | http body          |  \"{\\\"data\\\":\\\"OK\\\"}\"          |\n| `getQueryString()` | `std::string`                       | http querystring   |  \"Not Found\"              |\n| `getStatusCode()`  | `int`                               | http status code   |  404                    |\n| `getHeaders()`     | `std::map\u003cstd::string,std::string\u003e` | http headers       | (\"Content-Length\",\"15\") |\n\n* Note : You must delete your consumer when you are done with it (socket destroyed / destructor ...)\n\nComplete example in [httpdecoder-test/launcher.cpp](httpdecoder-test/launcher.cpp)\n\n## Example\n\n```\nhttpdecoder decoder;\n\nhttpconsumer *consumer = new httpconsumer;\n\nQByteArray *httpframe = new QByteArray(\"POST /rest/help/todo HTTP/1.1\\r\\n\"\n                                       \"headers1:  value1\\r\\n\"\n                                       \"headers2:  value2\\r\\n\"\n                                       \"Content-Length:  15\\r\\n\\r\\n\"\n                                       \"bodyTobeWritten\\r\\n\");\n\ndecoder.httpdecode(consumer, httpframe);\n```\n\n## Integrate in your project\n\n* from git submodule\n\n```\ngit submodule add git://github.com/bertrandmartel/http-streaming-decoder.git\n```\n\nand in your `project.pro` :\n\n```\nTEMPLATE = subdirs\nSUBDIRS = http-streaming-decoder your-app\nyour-app.depends = http-streaming-decoder\n```\n\nwith in `your-app.pro` :\n\n```\nTARGET = your-app\nSOURCES = main.cpp\nINCLUDEPATH += $$PWD/../http-streaming-decoder/httpdecoder/release\nLIBS += -L$$PWD/../http-streaming-decoder/httpdecoder/release -lhttpdecoder\nDEPENDPATH += $$PWD/../http-streaming-decoder/httpdecoder/release\n```\n\n## Build library\n\n```\nqmake\nmake\n```\n\n## Projects using this library\n\n* https://github.com/bertrandmartel/websocket-non-blocking\n\n## Compatibility\n\n* Qt4\n* Qt5\n\n## Specification\n\n* https://www.ietf.org/rfc/rfc2616.txt","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fhttp-streaming-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertrandmartel%2Fhttp-streaming-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fhttp-streaming-decoder/lists"}