{"id":13779734,"url":"https://github.com/koajs/override-method","last_synced_at":"2025-10-19T13:31:39.250Z","repository":{"id":15350083,"uuid":"18080868","full_name":"koajs/override-method","owner":"koajs","description":"method override utility for koa","archived":false,"fork":false,"pushed_at":"2017-02-27T11:12:58.000Z","size":2,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T13:08:40.633Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koajs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-24T22:16:08.000Z","updated_at":"2022-05-11T13:41:00.000Z","dependencies_parsed_at":"2022-07-13T21:34:29.368Z","dependency_job_id":null,"html_url":"https://github.com/koajs/override-method","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/koajs%2Foverride-method","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Foverride-method/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Foverride-method/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koajs%2Foverride-method/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koajs","download_url":"https://codeload.github.com/koajs/override-method/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869479,"owners_count":16555292,"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-08-03T18:01:08.654Z","updated_at":"2025-10-19T13:31:33.958Z","avatar_url":"https://github.com/koajs.png","language":"JavaScript","funding_links":[],"categories":["Middleware"],"sub_categories":[],"readme":"# Koa Override Method\n\nMethod override as a function utility.\n\n```js\nvar parse = require('co-body')\nvar override = require('koa-override-method')\n\napp.use(function* () {\n  var body = yield parse(this)\n  var method = override.call(this, body)\n\n  switch (method) {\n    case 'PUT':\n      // ...\n  }\n})\n```\n\n## API\n\n### var method = override.call(this, [body])\n\nYou must call the function with the koa `this` parameter. `body` is optional. `X-HTTP-Method-Override` is checked as well as the optional body.\n\n`method` is the uppercased method. If there is no override parameter, then it's simply `this.request.method`. You shouldn't use this unless you know you're using override.\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2014 Jonathan Ong me@jongleberry.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Foverride-method","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoajs%2Foverride-method","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoajs%2Foverride-method/lists"}