{"id":17656519,"url":"https://github.com/imdrasil/http_method_emulator","last_synced_at":"2025-08-01T13:09:24.982Z","repository":{"id":81841549,"uuid":"164110545","full_name":"imdrasil/http_method_emulator","owner":"imdrasil","description":" Simple HTTP method emulator for form submitted data.","archived":false,"fork":false,"pushed_at":"2019-01-04T13:49:13.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T17:50:45.559Z","etag":null,"topics":["crystal-language","http"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/imdrasil.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":"2019-01-04T13:25:59.000Z","updated_at":"2023-07-25T14:22:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f7554f2-7f30-4d43-8201-7945d0edb2a3","html_url":"https://github.com/imdrasil/http_method_emulator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/imdrasil/http_method_emulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imdrasil%2Fhttp_method_emulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imdrasil%2Fhttp_method_emulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imdrasil%2Fhttp_method_emulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imdrasil%2Fhttp_method_emulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imdrasil","download_url":"https://codeload.github.com/imdrasil/http_method_emulator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imdrasil%2Fhttp_method_emulator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268229552,"owners_count":24217015,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"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":["crystal-language","http"],"created_at":"2024-10-23T14:33:20.594Z","updated_at":"2025-08-01T13:09:24.931Z","avatar_url":"https://github.com/imdrasil.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http_method_emulator\n\nSimple HTTP method emulator for form submitted data.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n```yaml\ndependencies:\n  http_method_emulator:\n    github: imdrasil/http_method_emulator\n```\n2. Run `shards install`\n\n## Usage\n\nHTML form supports only `GET` and `POST` method. To bring other methods support you can use this shard. This shard will be useful for a web frameworks/libs that have no such functionality (like Kemal or Spider-Gazelle).\n\n```crystal\nrequire \"http_method_emulator\"\n\n# Add handler to your middlewares\n# like for Kemal\n\nadd_handler HTTPMethodEmulator::Handler::INSTANCE\n```\n\nAlso require `\"lib/http_method_emulator/assets/http_method_emulator.js\"` in your js assets.\n\nNow you can just create `POST` form with hidden field `_method` holding required method.\n\n```html\n\u003cform method=\"POST\" action=\"/some/path\"\u003e\n  \u003cinput type=\"hidden\" name=\"_method\" value=\"PATCH\"\u003e\n  \u003cbutton type=\"submit\"\u003eMake Request\u003c/button\u003e\n\u003c/form\u003e\n```\n\nJS catches submit event and add query parameter based on form `_method` field (or do nothing if it isn't exist). Handler modifies `POST` request method setting value sent in query `_method` field.\n\n### Configuration\n\nYou can specify field name to be used for holding method name. This should be done in two places - crystal and JS.\n\n```crystal\nHTTPMethodEmulator.config do |conf|\n  conf.key = \"http_method\"\nend\n```\n\n```js\n// Anywhere after js being imported\nwindow.HTTPMethodEmulator.key = \"http_method\"\n```\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/imdrasil/http_method_emulator/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Roman Kalnytskyi](https://github.com/imdrasil) - creator and maintainer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdrasil%2Fhttp_method_emulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimdrasil%2Fhttp_method_emulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdrasil%2Fhttp_method_emulator/lists"}