{"id":13705687,"url":"https://github.com/HashLoad/jhonson","last_synced_at":"2025-05-05T16:33:40.332Z","repository":{"id":37778785,"uuid":"151313209","full_name":"HashLoad/jhonson","owner":"HashLoad","description":"Middleware for parse JSON in HORSE","archived":false,"fork":false,"pushed_at":"2023-12-28T12:38:54.000Z","size":42,"stargazers_count":94,"open_issues_count":0,"forks_count":23,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-04-13T21:53:47.164Z","etag":null,"topics":["horse","json","middleware","parser"],"latest_commit_sha":null,"homepage":null,"language":"Pascal","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/HashLoad.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}},"created_at":"2018-10-02T19:43:57.000Z","updated_at":"2024-03-31T14:12:25.000Z","dependencies_parsed_at":"2024-01-01T09:07:36.317Z","dependency_job_id":"3fd34643-0e90-4985-a4d4-060724c89553","html_url":"https://github.com/HashLoad/jhonson","commit_stats":{"total_commits":42,"total_committers":8,"mean_commits":5.25,"dds":"0.45238095238095233","last_synced_commit":"47346d5ac46477e9f6d9d81bccdfe1c2d057f854"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fjhonson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fjhonson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fjhonson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HashLoad%2Fjhonson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HashLoad","download_url":"https://codeload.github.com/HashLoad/jhonson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224455907,"owners_count":17314204,"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":["horse","json","middleware","parser"],"created_at":"2024-08-02T22:00:46.110Z","updated_at":"2025-05-05T16:33:40.323Z","avatar_url":"https://github.com/HashLoad.png","language":"Pascal","readme":"# jhonson\n\u003cb\u003eJhonson\u003c/b\u003e is an official middleware for working with JSON in APIs developed with the \u003ca href=\"https://github.com/HashLoad/horse\"\u003eHorse\u003c/a\u003e framework.\n\u003cbr\u003eWe created a channel on Telegram for questions and support:\u003cbr\u003e\u003cbr\u003e\n\u003ca href=\"https://t.me/hashload\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/telegram-join%20channel-7289DA?style=flat-square\"\u003e\n\u003c/a\u003e\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command:\n``` sh\nboss install jhonson\n```\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../jhonson/src\n```\n\n## ✔️ Compatibility\nThis middleware is compatible with projects developed in:\n- [X] Delphi\n- [X] Lazarus\n\n## ⚡️ Quickstart Delphi\n```delphi\nuses \n  Horse, \n  Horse.Jhonson, // It's necessary to use the unit\n  System.JSON;\n\nbegin\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(Jhonson());\n  \n  // You can specify the charset when adding middleware to the Horse:\n  // THorse.Use(Jhonson('UTF-8')); \n\n  THorse.Post('/ping',\n    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)\n    var\n      LBody: TJSONObject;\n    begin\n      // Req.Body gives access to the content of the request in string format.\n      // Using jhonson middleware, we can get the content of the request in JSON format.\n      \n      LBody := Req.Body\u003cTJSONObject\u003e;\n      Res.Send\u003cTJSONObject\u003e(LBody);\n    end);\n\n  THorse.Listen(9000);\nend;\n```\n\n## ⚡️ Quickstart Lazarus\n```delphi\n{$MODE DELPHI}{$H+}\n\nuses\n  {$IFDEF UNIX}{$IFDEF UseCThreads}\n  cthreads,\n  {$ENDIF}{$ENDIF}\n  Horse, \n  Horse.Jhonson, // It's necessary to use the unit \n  fpjson, \n  SysUtils;\n\nprocedure PostPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);\nvar\n  LBody: TJSONObject;\nbegin\n  // Req.Body gives access to the content of the request in string format.\n  // Using jhonson middleware, we can get the content of the request in JSON format.\n  LBody := Req.Body\u003cTJSONObject\u003e;\n  Res.Send\u003cTJSONObject\u003e(LBody);\nend;\n\nbegin\n  // It's necessary to add the middleware in the Horse:\n  THorse.Use(Jhonson);\n  \n  // You can specify the charset when adding middleware to the Horse:\n  // THorse.Use(Jhonson('UTF-8')); \n\n  THorse.Post('/ping', PostPing);\n\n  THorse.Listen(9000);\nend.\n```\n\n## ⚠️ License\n`Jhonson` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/jhonson/blob/master/LICENSE). \n","funding_links":[],"categories":["Network"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fjhonson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHashLoad%2Fjhonson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHashLoad%2Fjhonson/lists"}