{"id":15471005,"url":"https://github.com/bu/gin-method-override","last_synced_at":"2025-04-22T12:43:22.423Z","repository":{"id":57491480,"uuid":"131519244","full_name":"bu/gin-method-override","owner":"bu","description":"MethodOverride middleware for Gin web framework","archived":false,"fork":false,"pushed_at":"2021-01-07T04:51:38.000Z","size":11,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T01:14:07.001Z","etag":null,"topics":["gin-middleware","golang","methodoverride","middleware"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/bu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-29T18:30:20.000Z","updated_at":"2024-06-13T13:36:25.000Z","dependencies_parsed_at":"2022-08-30T23:22:09.948Z","dependency_job_id":null,"html_url":"https://github.com/bu/gin-method-override","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu%2Fgin-method-override","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu%2Fgin-method-override/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu%2Fgin-method-override/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu%2Fgin-method-override/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bu","download_url":"https://codeload.github.com/bu/gin-method-override/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250242854,"owners_count":21398210,"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":["gin-middleware","golang","methodoverride","middleware"],"created_at":"2024-10-02T02:08:21.932Z","updated_at":"2025-04-22T12:43:22.403Z","avatar_url":"https://github.com/bu.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Gin MethodOverride Middleware\n\n![Go Report Card](https://goreportcard.com/badge/github.com/bu/gin-method-override)\n[![Build Status](https://travis-ci.org/bu/gin-method-override.svg?branch=master)](https://travis-ci.org/bu/gin-method-override)\n\nA [Gin web framework](https://github.com/gin-gonic/gin) middleware for method override by POST form param _method, inspired by [Ruby's same name rack](http://www.rubydoc.info/gems/rack/Rack/MethodOverride)\n\n## Usage\n\n### Server-side\n\n```go\n\npackage main\n\nimport (\n\tgin \"github.com/gin-gonic/gin\"\n\tmethod \"github.com/bu/gin-method-override\"\n)\n\nfunc main() {\n\t// create a Gin engine\n\tr := gin.Default()\n\n\t// our middle-ware\n\tr.Use(method.ProcessMethodOverride(r))\n\n\t// routes\n\tr.PUT(\"/test\", func (c *gin.Context) {\n\t\tc.String(200, \"1\")\n\t})\n\n\t// listen to request\n\tr.Run(\":8080\")\n}\n\n```\n\n## Client side\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003cform action=\"/test\" method=\"POST\"\u003e \u003c!-- form method rewrite only works with POST request --\u003e\n        \u003cinput type=\"hidden\" name=\"_method\" value=\"PUT\"\u003e\n        \u003cinput type=\"text\" name=\"testing\" value=\"1\"\u003e\n        \u003cbutton type=\"submit\"\u003eSend\u003c/button\u003e\n    \u003c/form\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbu%2Fgin-method-override","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbu%2Fgin-method-override","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbu%2Fgin-method-override/lists"}